duang8642 2015-11-17 14:22 采纳率: 0%
浏览 152
已采纳

Archlinux:golang不能使用go build

i installed archlinux few days ago, and i want to configure golang but there is some problem, I installed go from pacman :

pacman -S go

and i export some env var in my .bashrc

export PATH=$PATH:/usr/lib/go
export GOPATH=$HOME/go
export GOBIN=$GOPATH/bin

But when i build with "go build" i've got the error message :

main.go:11:2: no buildable Go source files in /usr/lib/go/src/go

go env includes:

GOBIN="/home/thomas/go/bin" GOEXE="" GOPATH="/home/thomas/go" GOROOT="/usr/lib/go" 
  • 写回答

1条回答 默认 最新

  • doumouyi4039 2015-11-17 17:19
    关注

    From the error message it seems like you might be trying to import the "go" package in main.go on line 11.

    Removing that import statement should fix the problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Mybatis#的问题:怎么办重复数据如下"KSDM":37,"KSMC":"呼吸内科门诊","ksdm":37,"ksmc":"呼吸内科门诊"xml文件填写
  • ¥40 servlet的web程序部署出错
  • ¥50 activiti 新建流程系列问题
  • ¥50 为什么我版本升级之后运行速度变慢5倍??
  • ¥15 如何在gazebo中加载机械臂和机械手
  • ¥15 纯运放实现隔离采样方案设计
  • ¥20 easyconnect无法连接后缀带.com的网站,一直显示找不到服务器ip地址,但是带有数字的网站又是可以连接上的,如何解决
  • ¥15 电脑开机过商标后就直接这样,求解各位
  • ¥15 mysql , 用自己创建的本地主机和用户名 登录不上
  • ¥15 关于#web项目#的问题,请各位专家解答!