dongrui6787 2016-08-26 18:01
浏览 62
已采纳

Go语言环境和路径

I have few apps cloned from github, but not sure if I do everything right. I recently installed go.

$ go
Go is a tool for managing Go source code.

Usage:

        go command [arguments]

The commands are:

        build       compile packages and dependencies
        clean       remove object files
        doc         show documentation for package or symbol
        env         print Go environment information
        fix         run go tool fix on packages
        fmt         run gofmt on package sources
        generate    generate Go files by processing source
        get         download and install packages and dependencies
        install     compile and install packages and dependencies
        list        list packages
        run         compile and run Go program
        test        test packages
        tool        run specified go tool
        version     print Go version
        vet         run go tool vet on packages

Use "go help [command]" for more information about a command.

Additional help topics:

        c           calling between Go and C
        buildmode   description of build modes
        filetype    file types
        gopath      GOPATH environment variable
        environment environment variables
        importpath  import path syntax
        packages    description of package lists
        testflag    description of testing flags
        testfunc    description of testing functions

Use "go help [topic]" for more information about that topic.

And I have things configured accordingly (exported variables etc..) also added them into ~/.bashrc however I still need to change directory and go to my go/bin folder.. is this what all are doing or there is something I can change. Would be great if you can point me on some sort of docs (not go lang please!).

I am on Mac OS X.

  • 写回答

3条回答 默认 最新

  • dourunlao1642 2016-08-26 18:29
    关注

    Verify that the binary you are trying to run is in your $GOPATH/bin directory, e.g. it should appear when you run ls $GOPATH/bin

    Next, verify that $GOPATH/bin is in your $PATH, e.g. it should appear with echo $PATH. If this $GOPATH/bin is not in your $PATH, add it e.g. export PATH=$GOPATH/bin:$PATH (you may want to add this to your .bashrc).

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么