Skip to content

Commit ae37910

Browse files
committed
Test compilation with ignoreUnknownFields flag
1 parent 2076368 commit ae37910

File tree

4 files changed

+467
-0
lines changed

4 files changed

+467
-0
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ gen-testproto: get-grpc-testproto gen-wkt-testproto install
5656
--go_out=. --plugin protoc-gen-go="${GOBIN}/protoc-gen-go" \
5757
--go-vtproto_out=allow-empty=true:. --plugin protoc-gen-go-vtproto="${GOBIN}/protoc-gen-go-vtproto" \
5858
-I$(PROTOBUF_ROOT)/src \
59+
testproto/ignore_unknown_fields/opt.proto \
5960
testproto/empty/empty.proto \
6061
testproto/pool/pool.proto \
6162
testproto/pool/pool_with_slice_reuse.proto \
@@ -106,4 +107,5 @@ genall: gen-include gen-conformance gen-testproto gen-wkt
106107
test: install gen-conformance
107108
go test -short ./...
108109
go test -count=1 ./conformance/...
110+
go test -count=1 ./testproto/ignore_unknown_fields/...
109111
GOGC="off" go test -count=1 ./testproto/pool/...

testproto/ignore_unknown_fields/opt.pb.go

Lines changed: 149 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
syntax = "proto3";
2+
option go_package = "testproto/ignore_unknown_fields";
3+
4+
import "github.com/planetscale/vtprotobuf/vtproto/ext.proto";
5+
6+
message IgnoreUnknownFieldsExtension {
7+
option (vtproto.ignore_unknown_fields) = true;
8+
string foo = 1;
9+
}

0 commit comments

Comments
 (0)