go get失败,原因是“在github.com/…中找不到可构建的Go源文件”

I'm trying to build a docker container where i can build my GAE go app. I'm using this container with gitlab.com later.

I have a container with latest golang-gae-sdk installed. I'm in my project root directory (/project), when i try to build it:

goapp build ./...

It get this response:

no buildable Go source files in /project/src/github.com/gorilla/mux

When i try to do get the packages:

goapp get ./...

I get the same response like before. The only way to build it is to delete the github.com folder. But shouldn't this be in the repository to have the correct version of dependencies in my git repo.

Can anyone help me or explain how this works?

I had a similar problem, where I couln't build although go was installed correctly and all the source files where present.

In my case the os was using an older go version than was required by the source. You can check the version with:

go --version

In your /project/src/github.com/gorilla/mux directory look at the first line of the main source file. It could contain a line like this:

// +build go1.5

This e.g. means you will at least need go 1.5 to build. In my case ubuntu was using an older version located at

whereis go

I deleted the old binary folder (probably something you shouldn't do) and reinstalled go from scratch, which gave me the correct version and the build worked fine.