// Chapter 26 example: a method belongs to a value, and a package function // belongs to a package. // Run with: go run exercises/26/04-method-or-function.go package main import ( "errors" "fmt" "strings" ) func main() { name := "keiko" // A function from the strings package. The string goes in as an argument. fmt.Println(strings.ToUpper(name)) // KEIKO // A method. err is a value, and Error is a method you can call on it. err := errors.New("out of arrows") fmt.Println(err.Error()) // out of arrows }