Looking for go Answers? Try Ask4KnowledgeBase
Looking for go Keywords? Try Ask4Keywords

Go Parameters


A function can optionally declare a set of parameters:

func SayHelloToMe(firstName, lastName string, age int) {
    fmt.Printf("Hello, %s %s!\n", firstName, lastName)
    fmt.Printf("You are %d", age)

Notice that the type for firstName is omitted because it is identical to lastName.