doumo0206 2015-01-16 09:40
浏览 339

Golang编译器/设置go路径出现问题

I have attempted setting a go path to multiple directories using export, i.e

export GOPATH=$(mktemp -d)

or

export GOPATH="$HOME/go"

etc.

I have attempted using multiple directories yet when I attempt to run "go get" I always run into the same error.

/usr/lib/go/src/pkg/github.com/golang/protobuf/proto/text.go:39:2: no Go source files in /usr/lib/go/src/pkg/encoding

All signs seem to point to the gopath not being set but I can assure you I have set it multiple times attempting to troubleshoot and when I cd to $GOPATH it brings me to the gopath I set.

If it is of any concern this is the repository I am attempting to access:

https://github.com/layeh/piepan

Thank you

  • 写回答

2条回答 默认 最新

  • dox19458 2015-04-09 18:18
    关注

    The GOPATH environment variable specifies the location of your workspace. It is likely the only environment variable you'll need to set when developing Go code.

    To get started, create a workspace directory and set GOPATH accordingly. Your workspace can be located wherever you like, but we'll use $HOME/go in this document. Note that this must not be the same path as your Go installation.

    $ mkdir $HOME/go

    $ export GOPATH=$HOME/go

    For convenience, add the workspace's bin subdirectory to your PATH:

    $ export PATH=$PATH:$GOPATH/bin

    you have to add you $GOPATH to $PATH, execute highlighted commands (change to your path)

    评论

报告相同问题?

悬赏问题

  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化