“unrecognized import path” with go get

后端 未结 9 770
你的背包
你的背包 2020-12-07 18:00

I\'m trying to install a web.go, but running go get github.com/hoisie/web returns

package bufio: unrecognized import path \"bufio\"         


        
相关标签:
9条回答
  • 2020-12-07 18:53

    Because GFW forbidden you to access golang.org ! And when i use the proxy , it can work well.

    you can look at the information using command go get -v -u golang.org/x/oauth2

    0 讨论(0)
  • 2020-12-07 18:55

    The most common causes are:
    1. An incorrectly configured GOROOT
    OR
    2. GOPATH is not set

    0 讨论(0)
  • 2020-12-07 19:02

    I had the same problem on MacOS 10.10. And I found that the problem caused by OhMyZsh shell. Then I switched back to bash everything went ok.

    Here is my go env

    bash-3.2$ go env
    GOARCH="amd64"
    GOBIN=""
    GOCHAR="6"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="darwin"
    GOOS="darwin"
    GOPATH="/Users/bis/go"
    GORACE=""
    GOROOT="/usr/local/go"
    GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
    CC="clang"
    GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
    CXX="clang++"
    CGO_ENABLED="1
    
    0 讨论(0)
提交回复
热议问题