Functions continued

When two or more consecutive named function parameters share a type, you can omit the type from all but the last.

In this example, we shortened

  1. x int, y int

to

  1. x, y int

functions-continued.go

  1. package main
  2. import "fmt"
  3. func add(x, y int) int {
  4. return x + y
  5. }
  6. func main() {
  7. fmt.Println(add(42, 13))
  8. }