Currently the default is the following
go get -t -d -v ./...
go build -v
However I doubt that this is ever a good idea, since dependency packages are never updated with this line of instructions. I suggest to include the -u
flag to go get
and -a
to go build -v
. Also to nuke the packages dir (rm -rf /home/ubuntu/{.go_workspace,.go_project}/pkg/*
) before building, to prevent incorrect caches to be used. This is especially important when Go’s version is changed.
Also I have a lot of issues getting Go Static-Analysis to work on Circle. This has to do with at least some of the following.
- GOPATH using an actual path (surprisingly not all tools can work with that perfectly…)
- GOPATH doesn’t actually specify the path the project is checked out into.
- A symlink is used to specify the path to the checked out version that is to be built. This is not a recommended approach although I don’t have hard evidence that it actually causes problems.
The default:
ubuntu@box2067:~$ echo $GOPATH
/home/ubuntu/.go_workspace:/usr/local/go_workspace
The more correct version:
ubuntu@box2067:~$ echo $GOPATH
/home/ubuntu/.go_project:/home/ubuntu/.go_workspace:/usr/local/go_workspace
However I might make a follow-up post on that particular problem as I’m not entirely sure what all the problems are. It’s frustrating that everything works fine locally but Circle is nothing but troubles.