修改后输出:后处理失败:820:39:参数列表缺少逗号
哈喽!大家好,很高兴又见面了,我是golang学习网的一名作者,今天由我给大家带来一篇《修改后输出:后处理失败:820:39:参数列表缺少逗号》,本文主要会讲到等等知识点,希望大家一起学习进步,也欢迎大家关注、点赞、收藏、转发! 下面就一起来看看吧!
protoc-gen-validate 是一个协议插件,用于生成多语言消息验证器。
该项目使用 bazel 进行构建,并有一个开放的拉取请求来添加对验证错误消息自定义的支持。
原始代码是2020年制作的。最近更新了最新代码,修复了所有合并冲突后,现在无法构建,但我找不到问题:
~/github/protoc-gen-validate (i18n) $ make bazel-tests bazel test //tests/... --test_output=errors info: analyzed 68 targets (0 packages loaded, 0 targets configured). info: found 62 targets and 6 test targets... error: /users/mparnisari/github/protoc-gen-validate/tests/harness/cases/build:46:21: generating into bazel-out/darwin-fastbuild/bin/tests/harness/cases/go_/github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go failed: (exit 1): go-protoc-bin failed: error executing command bazel-out/darwin-opt-exec-2b5cbbc6/bin/external/io_bazel_rules_go/go/tools/builders/go-protoc-bin_/go-protoc-bin -protoc bazel-out/darwin-opt-exec-2b5cbbc6/bin/external/com_google_protobuf/protoc ... (remaining 117 argument(s) skipped) use --sandbox_debug to see verbose messages from the sandbox [error] failed post-processing: 820:39: missing ',' in argument list (and 10 more errors) --validate_out: protoc-gen-validate: plugin failed with status code 1. 2021/12/14 23:46:43 error running protoc: exit status 1 error: /users/mparnisari/github/protoc-gen-validate/tests/harness/cases/build:46:21 gocompilepkg tests/harness/cases/go.a failed: (exit 1): go-protoc-bin failed: error executing command bazel-out/darwin-opt-exec-2b5cbbc6/bin/external/io_bazel_rules_go/go/tools/builders/go-protoc-bin_/go-protoc-bin -protoc bazel-out/darwin-opt-exec-2b5cbbc6/bin/external/com_google_protobuf/protoc ... (remaining 117 argument(s) skipped) use --sandbox_debug to see verbose messages from the sandbox info: elapsed time: 0.962s, critical path: 0.48s info: 8 processes: 8 internal. failed: build did not complete successfully
根据以下事实判断,在我触发测试命令后立即出现错误 ([error] failed post-processing: 820:39: missing ',' in argument list (and 10 more error)),我想这是 bazel 的问题,但我不确定。
更新 1:我将范围缩小到:
~/GitHub/fork/protoc-gen-validate (i18n) $ make testcases
cd tests/harness/cases && \
protoc \
-I . \
-I ../../.. \
--go_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go;other_package,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go,Mvalidate/validate.proto=github.com/envoyproxy/protoc-gen-validate/validate,Mgoogle/protobuf/any.proto=google.golang.org/protobuf/types/known/anypb,Mgoogle/protobuf/duration.proto=google.golang.org/protobuf/types/known/durationpb,Mgoogle/protobuf/struct.proto=google.golang.org/protobuf/types/known/structpb,Mgoogle/protobuf/timestamp.proto=google.golang.org/protobuf/types/known/timestamppb,Mgoogle/protobuf/wrappers.proto=google.golang.org/protobuf/types/known/wrapperspb,Mgoogle/protobuf/descriptor.proto=google.golang.org/protobuf/types/descriptorpb:./go" \
--plugin=protoc-gen-go=/Users/mparnisari/go/bin/protoc-gen-go \
--validate_out="module=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/go,lang=go,Mtests/harness/cases/other_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/other_package/go,Mtests/harness/cases/yet_another_package/embed.proto=github.com/envoyproxy/protoc-gen-validate/tests/harness/cases/yet_another_package/go:./go" \
./*.proto
filename-with-dash.proto:5:1: warning: Import validate/validate.proto is unused.
[error] failed post-processing: 820:39: missing ',' in argument list (and 10 more errors)
--validate_out: protoc-gen-validate: Plugin failed with status code 1.
make:
*** [testcases] Error 1
更新2:缩小范围。如果我删除这个文件:tests/harness/cases/maps.proto
make 测试用例 有效
更新3:缩小范围。如果我删除这些行:https://github.com/envoyproxy/protoc-gen-validate/blob/main/tests/harness/cases/maps.proto#l14-l17
make testcase 有效
正确答案
使用开关 --sandbox_debug 进行构建将提供未截断的堆栈跟踪。
这都是因为缺少一个逗号……唯一的问题是在哪个文件和行中。
它抱怨 harness_py_proto 测试 @ 46:21。建议对文件 tests/harness/executor/cases.go 运行语法检查,因为如果 820:39 不在某些生成的文件中,则这可能是最适合的文件(按行号和错误消息)。我对 go 语法不太熟悉,这就是为什么我无法一眼发现它 - 但语法检查器或 linter 可以:
lint bazel testcases bazel-tests
makefile 也可能是一个可能的候选者,但没有太多进展:
.phony: harness
harness: testcases tests/harness/go/harness.pb.go tests/harness/go/main/go-harness tests/harness/cc/cc-harness bin/harness ## runs the test harness, validating a series of test cases in all supported languages
./bin/harness -go -cc
.phony: bazel-tests
bazel-tests: ## runs all tests with bazel
bazel test //tests/... --test_output=errors
以前是否尝试过运行 makeharness?当它按照评论所说的那样时......
## runs the test harness, validating a series of test cases in all supported languages
今天关于《修改后输出:后处理失败:820:39:参数列表缺少逗号》的内容介绍就到此结束,如果有什么疑问或者建议,可以在golang学习网公众号下多多回复交流;文中若有不正之处,也希望回复留言以告知!
Flask框架安装教程:快速掌握Flask框架的安装步骤
- 上一篇
- Flask框架安装教程:快速掌握Flask框架的安装步骤
- 下一篇
- 使用jQuery删除元素的层叠顺序属性
-
- Golang · Go问答 | 5小时前 | sync.Pool · reset · 对象复用 · Go问答 · 线上排查 · Go sync.Pool Go问答 sync.Pool串数据 Reset清理 对象池复用
- Go sync.Pool 为什么会串数据:Reset 和 Put 的顺序怎么定
- 342浏览 收藏
-
- Golang · Go问答 | 9小时前 | [] · []
- Go time.After 写在循环里会泄漏吗:定时器堆积、Stop 和 NewTimer 复用怎么判断
- 181浏览 收藏
-
- Golang · Go问答 | 10小时前 | [] · []
- Go 解析 JSON 用 struct 还是 map[string]any:RawMessage 和严格校验怎么选
- 250浏览 收藏
-
- Golang · Go问答 | 10小时前 | [] · []
- Go 1.22 后 for range 闭包变量还要手动复制吗:循环变量语义变化和迁移检查
- 348浏览 收藏
-
- Golang · Go问答 | 11小时前 | select · 并发控制 · Go问答 · nil channel · select Go 并发控制 channel阻塞 Go问答 nil channel
- Go select 里的 nil channel 有什么用:为什么能动态关闭一个分支
- 467浏览 收藏
-
- Golang · Go问答 | 1天前 | channel · goroutine · pprof · Go问答 · 线上排查 · pprof Go问答 Go channel阻塞 goroutine堆积 channel发送
- Go channel 发送阻塞怎么排查:goroutine 堆积的线上处理手册
- 205浏览 收藏
-
- Golang · Go问答 | 1天前 | 连接池 · database/sql · Go问答 · 线上排查 · DBStats · MaxOpenConns Go数据库连接池 DBStats Go问答 sql.DB WaitCount
- Go 数据库连接池被打满怎么办:sql.DB 等待数上涨的排查手册
- 355浏览 收藏
-
- Golang · Go问答 | 1天前 | EventSource · sse · Go问答 · http.Flusher · 实时推送 · EventSource FLUSH text/event-stream Go问答 http.Flusher Go SSE
- Go 写 SSE 接口为什么浏览器收不到消息:EventSource、Flush 和超时怎么排查
- 333浏览 收藏
-
- Golang · Go问答 | 1天前 | 并发安全 · RWMutex · sync.Map · Go问答 · map并发 · RWMutex sync.Map Go问答 Go map并发读写 concurrent map writes
- Go map 并发读写为什么会 panic:从 fatal error 到三种修法
- 102浏览 收藏
-
- 前端进阶之JavaScript设计模式
- 设计模式是开发人员在软件开发过程中面临一般问题时的解决方案,代表了最佳的实践。本课程的主打内容包括JS常见设计模式以及具体应用场景,打造一站式知识长龙服务,适合有JS基础的同学学习。
- 543次学习
-
- GO语言核心编程课程
- 本课程采用真实案例,全面具体可落地,从理论到实践,一步一步将GO核心编程技术、编程思想、底层实现融会贯通,使学习者贴近时代脉搏,做IT互联网时代的弄潮儿。
- 516次学习
-
- 简单聊聊mysql8与网络通信
- 如有问题加微信:Le-studyg;在课程中,我们将首先介绍MySQL8的新特性,包括性能优化、安全增强、新数据类型等,帮助学生快速熟悉MySQL8的最新功能。接着,我们将深入解析MySQL的网络通信机制,包括协议、连接管理、数据传输等,让
- 500次学习
-
- JavaScript正则表达式基础与实战
- 在任何一门编程语言中,正则表达式,都是一项重要的知识,它提供了高效的字符串匹配与捕获机制,可以极大的简化程序设计。
- 487次学习
-
- 从零制作响应式网站—Grid布局
- 本系列教程将展示从零制作一个假想的网络科技公司官网,分为导航,轮播,关于我们,成功案例,服务流程,团队介绍,数据部分,公司动态,底部信息等内容区块。网站整体采用CSSGrid布局,支持响应式,有流畅过渡和展现动画。
- 485次学习
-
- ljg-skills
- ljg-skills 是李继刚开源的 AI 技能与提示词集合,面向大模型使用者整理了一批可复用的 prompt、角色设定和任务技能模板,适合用于学习提示词设计、搭建个人 AI 工作流和沉淀团队常用智能体能力。
- 4379次使用
-
- MELO音乐
- MELO音乐是一站式AI视频与音乐制作助手,对标suno, udio的高品质体验。提供伴奏生成、原创写词、无损导出、哼唱识曲、混音变声等全套音频与短视频编辑工具。无论是流行Kpop、电音说唱、民谣古风、摇滚儿歌还是商用轻音乐,MELO为你免费谱曲,轻松做同款!
- 4059次使用
-
- UniScribe
- UniScribe 是一款 AI 音视频转文字与内容整理工具,支持上传音频、视频文件或粘贴 YouTube 链接,自动生成转写文本、摘要、思维导图和关键问题,并支持多格式导出,适合会议记录、课程学习、访谈整理和内容创作复盘。
- 4041次使用
-
- 剧云
- 剧云是专业中文剧本创作平台,安全稳定运行十余年,集成AI编剧、剧本医生审核、人物小传、剧情关系图、大纲编写、多人协作、Word导入导出、版权管控功能,数据安全防护,轻松高效创作剧本。
- 4224次使用
-
- 万象有声
- 万象有声,一个专为有声创作者打造的新一代智能有声内容创作平台。平台提供专业的智能拆章、智能画本编辑、AI配音、AI生成音效、后期制作、智能对轨、智能审听等有声创作全流程工具,可以帮助创作者高效、低成本创作出引人入胜的有声作品。立即体验,让有声书制作更简单!
- 4193次使用
-
- 用Nginx反向代理部署go写的网站。
- 2023-01-17 502浏览
-
- GoLand调式动态执行代码
- 2023-01-13 502浏览
-
- 从不同的 go 例程将数据写入同一通道无需等待组即可正常工作
- 2024-04-29 501浏览
-
- Golang rsa-oaep解密失败,前端使用webcrypto
- 2024-04-26 501浏览
-
- 如何从用户输入以惰性方式初始化包的全局变量?
- 2024-04-24 501浏览

