dongliu6848 2018-12-07 08:36
浏览 944
已采纳

试图安装golang命令,但显示未找到命令

I have set my $GOPATH=$HOME/go and $GOROOT=usr/local/go

I tried to follow this tutorial so that I could do hot reload on my golang webserver

https://github.com/codegangsta/gin

I installed it via

go get github.com/codegangsta/gin

then I tried to run

gin -h

It shows command is not found

I have checked that the library is installed in my $GOPATH/bin

What should I do?

  • 写回答

1条回答 默认 最新

  • dongle19863 2018-12-07 09:40
    关注

    you need to add these commands to your shell startup (.bashrc or similar) or do them manually before using gin

    export GOPATH=$HOME/go
    export PATH=$GOPATH/bin:$PATH
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 R语言卸载之后无法重装,显示电脑存在下载某些较大二进制文件行为,怎么办
  • ¥15 java 的protected权限 ,问题在注释里