内容简介:go get 下载第三方包golang gin框架时,会去下载gopkg.in/go-playground/validator.v8包以及gopkg.in/yaml.v2包,gopkg.in站点下的包都是中间包,最终的包代码是在github上,于是直接到github.com上去下载,对应的真实代码地址是:
场景描述
go get 下载第三方包golang gin框架时,会去下载gopkg.in/go-playground/validator.v8包以及gopkg.in/yaml.v2包,gopkg.in站点下的包都是中间包,最终的包代码是在github上,于是直接到github.com上去下载,对应的真实代码地址是:
https://github.com/go-playground/validator/tree/v8.18.2
https://github.com/go-yaml/yaml/tree/v2.2.1
于是,我直接go get github.com/go-playground/validator 以及 go get github.com/go-yaml/yaml来获取,能够顺利下载包,但是在编译自己代码时会报错,仔细看了下是由于下载的包版本不对,并没有下载我们想要的版本,go get直接下载的是最新版本
解决方法
直接用git clone的方式去下载特定tag版本的代码,然后拷贝到相应的包目录下边
git clone --branch v8.18.2 https://github.com/go-playground/validator.git
git clone --branch v2.2.1 https://github.com/go-yaml/yaml.git
以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网
本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们。
Building Social Web Applications
Gavin Bell / O'Reilly Media / 2009-10-1 / USD 34.99
Building a social web application that attracts and retains regular visitors, and gets them to interact, isn't easy to do. This book walks you through the tough questions you'll face if you're to crea......一起来看看 《Building Social Web Applications》 这本书的介绍吧!