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

试图安装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?

图片转代码服务由CSDN问答提供 功能建议

我已经设置了 $ GOPATH = $ HOME / go $ GOROOT = usr / local / go

我尝试按照本教程进行操作,以便可以在golang网络服务器上进行热重装

< a href =“ https://github.com/codegangsta/gin” rel =“ nofollow noreferrer”> https://github.com/codegangsta/gin

I 通过

 安装了它,然后获取github.com/codegangsta/gin
  
 
 

然后我尝试运行

  gin -h 
   
 
 

显示未找到命令 < / blockquote>

我已检查该库是否已安装在我的 $ GOPATH / bin

我该怎么办?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongle19863
    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
    
    点赞 评论

相关推荐