Go mod graphql-go 的 Replace
2024-10-08 15:22:30
现在在项目中大量的使用 graphql,但用的版本是3年前的版本。
3年前包的url:github.com/neelance/graphql-go
现在的url:github.com/graph-gophers/graphql-go
升级成go mod之后出错了,因为graphql的语法发生了变化。这时候有一个搞笑的问题,你需要找到3年前的那个版本。
github.com/graph-gophers/graphql-go v0.0.0-20170406083916-01ab5128e53e
但是3年前的路径是 github.com/neelance/graphql-go,代码里都是这样使用的。
这时候go mod tidy,
go: github.com/graph-gophers/graphql-go imports
github.com/neelance/graphql-go/errors: github.com/neelance/graphql-go@v0.0.0-20200207002730-8334863f2c8b: parsing go.mod:
module declares its path as: github.com/graph-gophers/graphql-go
but was required as: github.com/neelance/graphql-go
好吧 replace 吧
replace github.com/neelance/graphql-go => github.com/graph-gophers/graphql-go v0.0.0--01ab5128e53e require github.com/neelance/graphql-go v0.0.0--
如果代码导入错误的,就替换所有的代码
最新文章
- 总结30个CSS3选择器
- spring boot(二):web综合开发
- 在SQL Server里我们为什么需要意向锁(Intent Locks)?
- 定时自动关闭messagebox
- 24.编写一个Car类,具有String类型的属性品牌,具有功能drive; 定义其子类Aodi和Benchi,具有属性:价格、型号;具有功能:变速; 定义主类E,在其main方法中分别创建Aodi和Benchi的对象并测试对象的特 性。
- BurpSuite使用设置
- linux命令:tail
- [Python] Python 之 __new__() 方法与实例化
- 【BZOJ1011】【HNOI2008】遥远的行星
- 转--Android实现ListView过滤功能,继承于BaseAdapter,非ArrayAdapter。
- Swiper之滑块2
- JavaScript入门(6)
- objective-c在Xcode中@property相关参数的解释
- iOS 摇一摇的实现-备用
- .OCX、.dll文件注册命令Regsvr32的使用
- 轻松搞定Linux端口转发
- Android屏幕适配问题详解
- java memcache应用
- Go语言数组的使用
- linux 下文件误删恢复