test.go has to be in the same package if is in the same directory. the package is thus
main for both of the files and being in the same package you can just call
Additionally you can build the entire package like this without specifying the single files.
export GOPATH="<path to>/test" go build main