gin框架安装

为了研究gin框架,真是废了大劲了,因此做下记录,在安装前,烧香拜佛保佑顺利。

执行 go get -x github.com/gin-gonic/gin


 

如果顺利,真要感谢老天爷

如果不顺利碰到:
(1)package gopkg.in/go-playground/validator.v8: gopkg.in/go-playground/validator.v8 is a custom import path for https://gopkg.in/go-playground/validator.v8, but /usr/local/go/src/gopkg.in/go-playground/validator.v8 is checked out from https://github.com/go-playground/validator.git

(2)package gopkg.in/yaml.v2: gopkg.in/yaml.v2 is a custom import path for https://gopkg.in/yaml.v2, but /usr/local/go/src/gopkg.in/yaml.v2 is checked out from https://github.com/go-yaml/yaml.git

绝招:

(1)去对应的上去进行下载你需要的包,如 git clone https://github.com/go-playground/validator.git  下载后是validator

(2) 在你的$GOPATH的src下去创建gopkg.in/go-playground目录(如果没有)

(3) 对validator进行重命名 mv validator validator.v8

(4) go install gopkg.in/go-playground/validator.v8

yaml.v2也是如此。

参考:

https://blog.csdn.net/mingzhehaolove/article/details/53112884

https://blog.csdn.net/liuliuzi_hz/article/details/52119575

 

 

你可能感兴趣的:(golang)