Go TutorialLesson 16Free preview
Go Functions
This lesson is part of Go · All levels
Summary
This lesson discusses declaration and use of functions in Go with the keyword func. A function can accept a parameter and return more than one value, including the value error that is the typical idiom of Go. Go also supports multiple return values and named return values to clarify the purpose of the function.
Key points
- Functions are declared with func type Results {}
- Go supports multiple return values, often used for results and errors
- A function without value again states the result as a func that has no result type
- Calling a function using nama_fungsi(argumen...)
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.