Skip to content

Commit ad01146

Browse files
authored
🧹 use vtproto (#5758)
Signed-off-by: Ivan Milchev <ivan@mondoo.com>
1 parent f40fb0a commit ad01146

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+53408
-136
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ prep/tools: prep/tools/protolint prep/tools/mockgen
6767
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
6868
go install go.mondoo.com/ranger-rpc/protoc-gen-rangerrpc@latest
6969
go install go.mondoo.com/ranger-rpc/protoc-gen-rangerrpc-swagger@latest
70+
go install github.com/planetscale/vtprotobuf/cmd/protoc-gen-go-vtproto@latest
7071

7172
prep/tools/mockgen:
7273
go install go.uber.org/mock/mockgen@latest

apps/cnquery/cmd/plugin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (c *cnqueryPlugin) RunQuery(conf *run.RunQueryConfig, runtime *providers.Ru
126126
// anyResultFailed is a flag that will be switched on if any query result failed,
127127
// if the flag `exit-1-on-failure` is provided and anyResultFailed is true, we
128128
// will exit the program with the exit code `1`
129-
var anyResultFailed = false
129+
anyResultFailed := false
130130
// we defer this check since we want it to be the last thing to be evaluated
131131
defer func() {
132132
if conf.GetExit_1OnFailure() && anyResultFailed {
@@ -207,7 +207,7 @@ func (c *cnqueryPlugin) RunQuery(conf *run.RunQueryConfig, runtime *providers.Ru
207207
}
208208

209209
if conf.Format == "llx" && conf.Output != "" {
210-
out, err := proto.Marshal(code)
210+
out, err := code.MarshalVT()
211211
if err != nil {
212212
return errors.Wrap(err, "failed to marshal code bundle")
213213
}

0 commit comments

Comments
 (0)