Skip to content

Commit

Permalink
Test compilation with ignoreUnknownFields flag
Browse files Browse the repository at this point in the history
  • Loading branch information
codesoap committed Oct 10, 2024
1 parent 2076368 commit ae37910
Show file tree
Hide file tree
Showing 4 changed files with 467 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ gen-testproto: get-grpc-testproto gen-wkt-testproto install
--go_out=. --plugin protoc-gen-go="${GOBIN}/protoc-gen-go" \
--go-vtproto_out=allow-empty=true:. --plugin protoc-gen-go-vtproto="${GOBIN}/protoc-gen-go-vtproto" \
-I$(PROTOBUF_ROOT)/src \
testproto/ignore_unknown_fields/opt.proto \
testproto/empty/empty.proto \
testproto/pool/pool.proto \
testproto/pool/pool_with_slice_reuse.proto \
Expand Down Expand Up @@ -106,4 +107,5 @@ genall: gen-include gen-conformance gen-testproto gen-wkt
test: install gen-conformance
go test -short ./...
go test -count=1 ./conformance/...
go test -count=1 ./testproto/ignore_unknown_fields/...
GOGC="off" go test -count=1 ./testproto/pool/...
149 changes: 149 additions & 0 deletions testproto/ignore_unknown_fields/opt.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions testproto/ignore_unknown_fields/opt.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
syntax = "proto3";
option go_package = "testproto/ignore_unknown_fields";

import "github.com/planetscale/vtprotobuf/vtproto/ext.proto";

message IgnoreUnknownFieldsExtension {
option (vtproto.ignore_unknown_fields) = true;
string foo = 1;
}
Loading

0 comments on commit ae37910

Please sign in to comment.