Now I'm really confused. Here is my problem (Go is new to me):
Firs file:
// main.go
package main
import "./libraries/test"
func main() {
test.foo()
}
Second file:
// test.go
package test
import "fmt"
func foo() {
fmt.Println("foo")
}
My structure looks like this:
main.go
/libraries
/test
test.go
If I compile this code I'll get this error messages:
./main.go:7: cannot refer to unexported name test.foo
./main.go:7: undefined: test.foo
If I change foo
to Foo
everywhere the error is gone and the program works as expected.