How to access resource files after the 'go' tool installed the executable?

后端 未结 3 1169
情书的邮戳
情书的邮戳 2020-12-18 03:07

Lets assume that running go install -v importpath builds an executable and installs it into $GOPATH/bin/program. The go tool is unable

3条回答
  •  臣服心动
    2020-12-18 03:42

    GOPATH environment variable

    On Unix, the value is a colon-separated string. On Windows, the value is a semicolon-separated string. On Plan 9, the value is a list.

    Therefore, $GOPATH/bin/program and $GOPATH/src/importpath are not necessarily valid. For example, on Linux,

    $ GOPATH=$HOME/gopath:$HOME/go
    $ cd $GOPATH/bin/go
    bash: cd: /home/peter/gopath:/home/peter/go/bin/go: No such file or directory
    

提交回复
热议问题