Skip to content

Commit 60fb5c0

Browse files
committed
adding examples for multiple return types
1 parent 4ef72f4 commit 60fb5c0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

functions/main.go

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ func Run() {
77
functionWithArgs(1, 2, 3, 4, 5)
88
functionSingleReturn()
99
functionMultipleReturnValues()
10+
// To 'ignore' return values and indicate we won't use them,
11+
// The underscore `_` should be used.
12+
one, _, _ := functionMultipleReturnValues()
13+
fmt.Println(one)
1014
}
1115

1216
func noReturnFunction() {

0 commit comments

Comments
 (0)