Quick actions

cmd+k|ctrl+k

Navigation

Languages

Variables / Blank identifier / Essential Go

Snippet info

Language

Go

Visibility

public

Author

kkowalczyk

Created

2019-03-26T10:12:11Z

Updated

2019-03-26T10:12:11Z

package main

import "fmt"

func SumProduct(a, b int) (int, int) {
	return a + b, a * b
}

func main() {
	// only need the sum
	sum, _ := SumProduct(1, 2) // the product gets discarded
	fmt.Println(sum)           // -> 3
}
INFO