I have a few files in the main package under one directory:
main.go config.go server.go
When I do: "go build" the program builds perfect and runs fine. When I do: "go run main.go" it fails.
Output:
# command-line-arguments
./main.go:7: undefined: Config
./main.go:8: undefined: Server
The symbols that are undefined are structs and they are capitalised so should be exported.
My Go version: go1.1.2 linux/amd64
packageformain.goandconfig.gowithserver.go? If you are going to run them all three must havepackage main.go runis fairly limited. You should be usinggo buildto build your package(s) and running it with ./packagename or packagename if it's on your PATH.