导致错误消息类似“内部错误:未能找到...”的嵌入式文件的原因。在去?
我已经在分支上工作了几天。同时,Master
分支已经发展,所以我做git rebase master
。
输出在某些文件中显示冲突:
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: could not apply 1bd673ea... update vendor folder
Resolve all conflicts manually, mark them as resolved with
update vendor folder
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 1bd673ea... update vendor folder
解决冲突后,我做go mod tidy
,然后go mod vendor
。结果是一个奇怪的消息:
内部错误:未能找到github.com/grpc-ecosystem/grpc-gateway/v2/runtime:// go:build build comment nover/ +构建注释
这是什么意思,我如何避免它?
I have been working on my branch for a couple of days. Meanwhile the master
branch has evolved, so I do git rebase master
.
The output shows CONFLICTs in some files:
Auto-merging vendor/modules.txt
CONFLICT (content): Merge conflict in vendor/modules.txt
Auto-merging go.sum
CONFLICT (content): Merge conflict in go.sum
Auto-merging go.mod
CONFLICT (content): Merge conflict in go.mod
error: could not apply 1bd673ea... update vendor folder
Resolve all conflicts manually, mark them as resolved with
update vendor folder
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply 1bd673ea... update vendor folder
After fixing the conflicts, I do go mod tidy
and then go mod vendor
. The result is a strange message:
internal error: failed to find embedded files of github.com/grpc-ecosystem/grpc-gateway/v2/runtime: //go:build comment without // +build comment
What does this mean and how can I avoid it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在最终错误消息
// GO中:构建注释没有// +构建注释
,它看起来之一是期望新的// GO:build
和旧// +构建
构建约束样式。我的猜测是因为您的go.mod
说您要支持一个超过1.18的版本(当// +构建
变得过时时),但是此GRPC-GATEWAY
软件包是为GO 1.18编写的,仅包括// GO:build
样式约束。查看,看来它确实只有一个
// go:构建
注释,但是go.mod
表示应该支持GO 1.17。因此看来该软件包被打破了...实际上,看起来有一个与此相关的公开问题。因此,您可能必须等待他们修复它,使用有效的旧版本,或在您自己的go.mod
中使用替换
来使用叉子。我认为几天前的发布 v2.10.2 ,当添加
// go:build>
line和no// +build +build
一个时,该fuzz文件被添加时。更新:看起来像 v2.10.3 。
From the final error message
//go:build comment without // +build comment
, it looks one of the tools is expecting both the new//go:build
and the old// +build
build constraint styles. My guess is this is because yourgo.mod
says you want to support a version of Go older than 1.18 (when// +build
became obsolete) but thisgrpc-gateway
package is written for Go 1.18 and only includes a//go:build
style constraint.Looking at the source of the file in question, it looks like it does only have a
//go:build
comment, but thego.mod
says it should support Go 1.17. So it seems like that package is broken... in fact, looks like there's an open issue related to that. So you'll probably have to wait for them to fix it, use an older version that works, or use areplace
in your owngo.mod
to use a fork.I think this was broken a few days ago with the release of v2.10.2, when that fuzz file was added with the
//go:build
line and no// +build
one.Update: looks like this has been fixed in v2.10.3.