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
- Named Return Parameters in Golang
- Golang Program that Uses Multiple Return Values
- Naming the Return Values of a Function in Golang
- 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?
- Scala | Named Arguments
- Named List in R Programming
- Program to shift all zero to the end of array in Golang
- Golang Program that uses String Switch
- Golang program that uses defer keyword
- Golang program that uses fallthrough keyword
- Golang program that uses structs as map keys
- Golang program that uses func with two arguments
- Golang program that uses switch, multiple value cases
- Golang Program that uses func as Local Variable
- Golang Program that Removes Duplicates Using Nested Loops
- Golang program that removes duplicates, ignores order
- Golang program that uses func with variable argument list
- Golang Program that switch on floating-point numbers
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.