Monday, 11 April 2016

go initial errors "cannot refer to unexported name fmt.printf"


I'm getting started with golang, just recording my initial hiccups and the solutions.

cannot refer to unexported name fmt.printf
hello/hello.go:6: undefined: fmt.printf

Golang is case sensitive , hence the function is fmt.Printf , with a capital P.

In Go, a name is exported if it begins with a capital letter. For example, Pizza is an exported name, as is Pi, which is exported from the math package.

1 comment: