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 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog