douqiao7958 2016-05-27 10:05
浏览 632

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?

  • 写回答

1条回答 默认 最新

  • dongni1892 2016-12-04 09:18
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)
  • ¥15 keil里为什么main.c定义的函数在it.c调用不了