go cannot find package "github.com/gorilla/websocket"

 

go cannot find package "github.com/gorilla/websocket"

wfs_server_lite.go:9:5: cannot find package "github.com/gorilla/websocket" in any of:
        E:\Go\src\github.com\gorilla\websocket (from $GOROOT)
        C:\Users\sbdya\go\src\github.com\gorilla\websocket (from $GOPATH)

 

解决方法:

1.配置环境变量GOROOT GOPATH

GOPATH随意指定目录,根目录下面需要src bin pkg三个目录。

2.go get "github.com/gorilla/websocket"

安装好了之后,安装地址在:GOPATH的pkg目录下:

E:\gopath\pkg

你可能感兴趣的:(go)