Variables / Blank identifier / Essential Go
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