// Two ways of doing multiple returns in Go. // Personally I find named returns to be more confusing than useful // // author ggtowell // Created: August, 2021 package main import ( "fmt" ) func main() { a, b, c := multiple() fmt.Printf("%s %f %d\n", a, b, c) a, b, c = multipleNamed() fmt.Printf("%s %f %d\n", a, b, c) } func multiple() (string, float32, int) { return "this", 3.415, 42 } func multipleNamed() (ss string, ff float32, ii int) { ss = "that" ff = 1.414 ii = 0 return }