现象

#go mod tidy
....
....
go: go.mod/test/e2e/kubectl imports
        github.com/googleapis/gnostic/OpenAPIv2: github.com/googleapis/gnostic@v0.6.9: parsing go.mod
:
        module declares its path as: github.com/google/gnostic
                but was required as: github.com/googleapis/gnostic
               

错误意思是模块将其路径声明为:github.com/google/gnostic 但被要求:github.com/googleapis/gnostic

解决办法:

在你当前的项目下的go.mod文件中加入

replace github.com/googleapis/gnostic => github.com/google/gnostic v0.6.9 

格式为:

replace module declares its path as:(后边那部分) => but was required as:(后边那部分)

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐