Closed KantarBruceAdams closed 5 years ago
Hi @KantarBruceAdams
This works for me on a vanilla go environment (go 1.8.7, but should work on all go version before/after):
go get -u github.com/Parquery/gocontracts
ls $GOPATH/bin
and gives:
gocontracts
Also testing:
$ cd $GOPATH/src/github.com/Parquery/gocontracts
$ go test ./...
gives:
? github.com/Parquery/gocontracts [no test files]
ok github.com/Parquery/gocontracts/gocontracts 0.005s
? github.com/Parquery/gocontracts/gocontracts/testcases [no test files]
I think you can't just download the source code and work on it without the prefix "github.com/Parquery/gocontracts".
Please let me know if the above does not work for you.
go get works. and get test works from $GOPATH/src/github.com/Parquery/gocontracts/gocontracts. I think some confusion comes from gocontracts being both a sub-directory and the tool name. So:
cd $GOPATH/src/github.com/Parquery/gocontracts go build go install github.com/Parquery/gocontracts: build output "gocontracts" already exists and is a directory go build *.go --> creates main() go build -o blah works though
However if I do not have $GOPATH/src/github.com/Parqeury/gocontracts but something like $GOPATH/src/Parqeury/gocontracts then
go build *.go main.go:6:2: cannot find package "github.com/Parquery/gocontracts/gocontracts" in any of: /usr/lib/go-1.7/src/github.com/Parquery/gocontracts/gocontracts (from $GOROOT) /home/brucea/download/go17/src/github.com/Parquery/gocontracts/gocontracts (from $GOPATH)
This comes from main doing import "github.com/Parquery/gocontracts/gocontracts" If I change it to "Parquery/gocontracts/gocontracts" it works.
I would have thought the build be location independent but that is not the go way.
This is probably me being foolish but I cannot get this to build or run the tests. I am using go 1.7.4 on Debian 9, though I tried go 1.11 as well briefly. Any idea what I might be doing wrong?