栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Go语言

Go:no required module provides package...to add it:...

Go语言 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Go:no required module provides package...to add it:...

Go:no required module provides package…to add it:…
记录一次Go编译报错 项目地址:

https://github.com/apache/servicecomb-service-center

源码修改:

将项目根目录中frontend重命名为frontend-src:

编译报错:
$ go build -o frontend
server.go:25:2: no required module provides package github.com/apache/servicecomb-service-center/frontend/schema; to add it:
        go get github.com/apache/servicecomb-service-center/frontend/schema

根据报错提示尝试解决:

EB@DESKTOP-K45IA6V MINGW64 /d/workspace/sme/trunk/servicecomb/servicecomb-service-center-1.3.0/frontend-src
$ go get github.com/apache/servicecomb-service-center/frontend/schema
go get: module github.com/apache/servicecomb-service-center/frontend/schema: reading https://goproxy.io/github.com/apache/servicecomb-service-ce
nter/frontend/schema/@v/list: 404 Not Found
        server response: not found: github.com/apache/servicecomb-service-center/frontend/schema@latest: no matching versions for query "latest"

仍然报错。(因为确实没有这个module)

解决方法:

猛然想起,自己rename frontend to frontend-src,但是没有修改源码中的导入路径:

修改项目内部目录(包名、位置发生变化),也应当修改项目内部依赖此包的文件中对此包的导入路径:

rename

import “github.com/apache/servicecomb-service-center/frontend/schema”

to

import “github.com/apache/servicecomb-service-center/frontend-src/schema”

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/903266.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号