It’s not empty, in Go, the return type is after the function parameters. In this case, split returns (int, int), meaning it returns two integers
split
I understand that (int, int) means that it returns two integers, but I'm not sure where you state which integers?
(int, int)
It has me wondering because, in a function with more than two integers, what is returned?
func foo(a int) (int, int) { x := 1; y := 2; z := a * (x + y); return }
Oh I see. Looks like the author forgot to put in the returned values, didn’t notice that!
Oh.. I meant to use that syntax since I only had two variables I wanted to return. Thanks for your observations anyways.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
It’s not empty, in Go, the return type is after the function parameters. In this case,
split
returns (int, int), meaning it returns two integersI understand that
(int, int)
means that it returns two integers, but I'm not sure where you state which integers?It has me wondering because, in a function with more than two integers, what is returned?
Oh I see. Looks like the author forgot to put in the returned values, didn’t notice that!
Oh.. I meant to use that syntax since I only had two variables I wanted to return. Thanks for your observations anyways.