Golang functions have special functionality that allows them to provide the name to the return values. These named return values can be used as arguments or variables. The named return values also use the default values for the data types like 0 for int type etc. To understand this concept let’s take an example:
Displaying Default Values For Named Return Values 0 0 Displaying Assigned Values For Named Return Values 2499 7499
- Golang Program that Uses Multiple Return Values
- Named Return Parameters in Golang
- Golang program that uses fallthrough keyword
- Golang Program that uses String Switch
- Golang program that uses structs as map keys
- Golang program that uses switch, multiple value cases
- Golang program that uses func with variable argument list
- Golang program that uses func with two arguments
- Golang program that uses defer keyword
- Golang Program that uses func as Local Variable
- Naming the Return Values of a Function in Golang
- Scala | Named Arguments
- Named List in R Programming
- Header files in C/C++ and its uses
- How to return multiple values from function in PHP?
- How to Remove Duplicate Values from Slice in Golang?
- How to compare Structs with the Different Values Assigned to Data Fields in Golang?
- What does main() return in C and C++?
- Mapping external values to dataframe values in Pandas
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.