From 25ceb8655bf99b0350228e6c33cc2c4fdf6089c5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Apr 2023 18:58:00 +0000 Subject: [PATCH 1/4] Bump actions/setup-go from 3 to 4 Bumps [actions/setup-go](https://github.com/actions/setup-go) from 3 to 4. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/setup-go dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/go-code.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/go-code.yml b/.github/workflows/go-code.yml index 36c655e..a970102 100644 --- a/.github/workflows/go-code.yml +++ b/.github/workflows/go-code.yml @@ -13,7 +13,7 @@ jobs: - name: Check out code uses: actions/checkout@v3 - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v4 with: go-version: "~1.17" - name: Initialize Go module cache From 1c591e4cf51497d23069e0611925dc758b6de93b Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Mon, 3 Apr 2023 18:17:08 +0200 Subject: [PATCH 2/4] Remove explicit caching --- .github/workflows/go-code.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/go-code.yml b/.github/workflows/go-code.yml index a970102..21f948b 100644 --- a/.github/workflows/go-code.yml +++ b/.github/workflows/go-code.yml @@ -7,7 +7,7 @@ on: jobs: test: name: Go Test - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 timeout-minutes: 10 steps: - name: Check out code @@ -15,14 +15,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "~1.17" - - name: Initialize Go module cache - uses: actions/cache@v3 - with: - path: ~/go/pkg/mod - key: go-mod-${{ runner.os }}-${{ hashFiles('**/go.sum') }} - restore-keys: | - go-mod-${{ runner.os }}- + go-version: "~1.19" - name: Clean Build run: make clean build - name: Go Test From 8338b317fd9660ba68693fbff9b44a00a2ad6910 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Mon, 3 Apr 2023 18:24:04 +0200 Subject: [PATCH 3/4] Remove gogo references --- Makefile | 26 +- cmd/protoc-gen-go-flags/main.go | 2 +- go.mod | 1 - go.sum | 30 - gogo/gogo.go | 29 - internal/gen/gen.go | 1 - internal/gen/messages.go | 46 -- internal/gen/messages_set.go | 10 - internal/gogoproto/gogo.pb.go | 1299 ------------------------------- internal/gogoproto/gogo.proto | 143 ---- test/enums.proto | 34 +- test/gogo.proto | 110 --- test/gogo/api.pb.go | 34 - test/gogo/enums.pb.go | 473 ----------- test/gogo/enums_flags.pb.go | 372 --------- test/gogo/enums_test.go | 153 ---- test/gogo/gogo.pb.go | 365 --------- test/gogo/gogo_flags.pb.go | 393 ---------- test/gogo/gogo_test.go | 93 --- test/gogo/message.pb.go | 330 -------- test/gogo/message_flags.pb.go | 137 ---- test/gogo/message_test.go | 130 ---- test/gogo/scalars.pb.go | 941 ---------------------- test/gogo/scalars_flags.pb.go | 1005 ------------------------ test/gogo/scalars_test.go | 310 -------- test/gogo/utils_test.go | 54 -- test/gogo/wkts.pb.go | 893 --------------------- test/gogo/wkts_flags.pb.go | 932 ---------------------- test/gogo/wkts_test.go | 306 -------- test/golang/enums.pb.go | 400 ++-------- test/golang/enums_flags.pb.go | 106 --- test/golang/gogo.pb.go | 709 ----------------- test/golang/gogo_flags.pb.go | 406 ---------- test/golang/gogo_test.go | 91 --- test/golang/message.pb.go | 87 +-- test/golang/utils_test.go | 1 - test/message.proto | 1 - 37 files changed, 129 insertions(+), 10324 deletions(-) delete mode 100644 gogo/gogo.go delete mode 100644 internal/gogoproto/gogo.pb.go delete mode 100644 internal/gogoproto/gogo.proto delete mode 100644 test/gogo.proto delete mode 100644 test/gogo/api.pb.go delete mode 100644 test/gogo/enums.pb.go delete mode 100644 test/gogo/enums_flags.pb.go delete mode 100644 test/gogo/enums_test.go delete mode 100644 test/gogo/gogo.pb.go delete mode 100644 test/gogo/gogo_flags.pb.go delete mode 100644 test/gogo/gogo_test.go delete mode 100644 test/gogo/message.pb.go delete mode 100644 test/gogo/message_flags.pb.go delete mode 100644 test/gogo/message_test.go delete mode 100644 test/gogo/scalars.pb.go delete mode 100644 test/gogo/scalars_flags.pb.go delete mode 100644 test/gogo/scalars_test.go delete mode 100644 test/gogo/utils_test.go delete mode 100644 test/gogo/wkts.pb.go delete mode 100644 test/gogo/wkts_flags.pb.go delete mode 100644 test/gogo/wkts_test.go delete mode 100644 test/golang/gogo.pb.go delete mode 100644 test/golang/gogo_flags.pb.go delete mode 100644 test/golang/gogo_test.go diff --git a/Makefile b/Makefile index d2d0b73..d7bb90a 100644 --- a/Makefile +++ b/Makefile @@ -18,13 +18,10 @@ clean: annotations/annotations.pb.go: .dev/protoc-gen-go-flags/annotations.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I .dev --go_opt=module=github.com/TheThingsIndustries/protoc-gen-go-flags --go_out=./ $< -internal/gogoproto/gogo.pb.go: internal/gogoproto/gogo.proto .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go - PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/gogoproto/gogo.proto - internal/flagsplugin/annotations.pb.go: internal/flagsplugin/annotations.proto protoc -I . --go_opt=paths=source_relative --go_out=./ ./internal/flagsplugin/annotations.proto -BINARY_DEPS = annotations/annotations.pb.go internal/gogoproto/gogo.pb.go $(wildcard cmd/protoc-gen-go-flags/*.go) $(wildcard internal/gen/*.go) +BINARY_DEPS = annotations/annotations.pb.go $(wildcard cmd/protoc-gen-go-flags/*.go) $(wildcard internal/gen/*.go) VERSION ?= 0.0.0-dev @@ -39,8 +36,6 @@ LDFLAGS = -X github.com/TheThingsIndustries/protoc-gen-go-flags/internal/gen.Ver .bin/protoc-gen-go-flags-linux-arm64: $(BINARY_DEPS) CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -ldflags "$(LDFLAGS)" -o $@ ./cmd/protoc-gen-go-flags -REPLACES = Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/field_mask.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/struct.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/wrappers.proto=github.com/gogo/protobuf/types - .PHONY: build build: .bin/protoc-gen-go-flags .bin/protoc-gen-go-flags-linux-amd64 .bin/protoc-gen-go-flags-linux-arm64 @@ -63,33 +58,18 @@ endif curl -sSL -o .dev/golangproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-$(OS)-x86_64.zip unzip -o .dev/golangproto/protoc.zip -d .dev/golangproto/ -.dev/gogoproto/bin/protoc: - mkdir -p .dev/gogoproto/bin - curl -sSL -o .dev/gogoproto/protoc.zip https://github.com/protocolbuffers/protobuf/releases/download/v3.9.1/protoc-3.9.1-$(OS)-x86_64.zip - unzip -o .dev/gogoproto/protoc.zip -d .dev/gogoproto/ - curl -sSL -o .dev/gogoproto/gogoproto.zip https://github.com/gogo/protobuf/archive/refs/heads/master.zip - unzip -o .dev/gogoproto/gogoproto.zip protobuf-master/protobuf/google/protobuf/*.proto -d .dev/gogoproto - mv .dev/gogoproto/protobuf-master/protobuf/google/protobuf/*.proto .dev/gogoproto/include/google/protobuf/ - .dev/golangproto/bin/protoc-gen-go: go build -o $@ google.golang.org/protobuf/cmd/protoc-gen-go -.dev/gogoproto/bin/protoc-gen-gogo: - go build -o $@ github.com/gogo/protobuf/protoc-gen-gogo - .PHONY: testprotos -testprotos: build .dev/golangproto/bin/protoc .dev/gogoproto/bin/protoc .dev/golangproto/bin/protoc-gen-go .dev/gogoproto/bin/protoc-gen-gogo +testprotos: build .dev/golangproto/bin/protoc .dev/golangproto/bin/protoc-gen-go PATH="$$PWD/.bin:$$PWD/.dev/golangproto/bin:$$PATH" protoc -I ./test -I . \ --go_opt=paths=source_relative --go_out=./test/golang \ --go-flags_opt=paths=source_relative --go-flags_out=./test/golang \ ./test/*.proto - PATH="$$PWD/.bin:$$PWD/.dev/gogoproto/bin:$$PATH" protoc -I ./test -I . \ - --gogo_opt=paths=source_relative --gogo_opt=$(REPLACES) --gogo_out=./test/gogo \ - --go-flags_opt=paths=source_relative --go-flags_opt=$(REPLACES) --go-flags_opt=lang=gogo --go-flags_out=./test/gogo \ - ./test/*.proto .PHONY: test test: testprotos - go test ./flagsplugin ./test/gogo ./test/golang + go test ./flagsplugin ./test/golang diff --git a/cmd/protoc-gen-go-flags/main.go b/cmd/protoc-gen-go-flags/main.go index a760dcc..a827525 100644 --- a/cmd/protoc-gen-go-flags/main.go +++ b/cmd/protoc-gen-go-flags/main.go @@ -21,7 +21,7 @@ func main() { } var flags flag.FlagSet - flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go or gogo)") + flags.StringVar(&plugin.Params.Lang, "lang", "go", "language (go)") flags.StringVar(&plugin.Params.CustomTypeGetterPrefix, "customtype.getter-prefix", "Get", "prefix for customtype getter func") flags.StringVar(&plugin.Params.CustomTypeGetterSuffix, "customtype.getter-suffix", "", "suffix for customtype getter func") diff --git a/go.mod b/go.mod index 6f5b56b..7497d15 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,6 @@ module github.com/TheThingsIndustries/protoc-gen-go-flags go 1.17 require ( - github.com/gogo/protobuf v1.3.2 github.com/google/go-cmp v0.5.9 github.com/spf13/pflag v1.0.5 google.golang.org/protobuf v1.28.1 diff --git a/go.sum b/go.sum index fd01c99..37cc20e 100644 --- a/go.sum +++ b/go.sum @@ -1,40 +1,10 @@ -github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= -github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= -github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= -github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= -golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= diff --git a/gogo/gogo.go b/gogo/gogo.go deleted file mode 100644 index 0d05b90..0000000 --- a/gogo/gogo.go +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -package gogoplugin - -import ( - "time" - - "github.com/gogo/protobuf/types" -) - -// SetDuration converts time to *types.Duration -func SetDuration(t time.Duration) *types.Duration { - return types.DurationProto(t) -} - -// SetFieldMask converts time to *types.FieldMask -func SetFieldMask(paths []string) *types.FieldMask { - return &types.FieldMask{Paths: paths} -} - -// SetTimestamp converts time to *types.Timestamp -func SetTimestamp(t time.Time) *types.Timestamp { - timestamp, err := types.TimestampProto(t) - if err != nil { - return nil - } - return timestamp -} diff --git a/internal/gen/gen.go b/internal/gen/gen.go index 5f3bf62..d011770 100644 --- a/internal/gen/gen.go +++ b/internal/gen/gen.go @@ -25,7 +25,6 @@ const ( pflagPackage = protogen.GoImportPath("github.com/spf13/pflag") flagspluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin") - gogoPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-flags/gogo") golangPluginPackage = protogen.GoImportPath("github.com/TheThingsIndustries/protoc-gen-go-flags/golang") ) diff --git a/internal/gen/messages.go b/internal/gen/messages.go index 5f985f0..3dec8d8 100644 --- a/internal/gen/messages.go +++ b/internal/gen/messages.go @@ -8,7 +8,6 @@ import ( "strings" "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - "github.com/TheThingsIndustries/protoc-gen-go-flags/internal/gogoproto" jsonannotations "github.com/TheThingsIndustries/protoc-gen-go-flags/internal/jsonplugin" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" @@ -45,64 +44,19 @@ func (g *generator) genMessage(message *protogen.Message) { func fieldIsNullable(field *protogen.Field) bool { // Typically, only message fields are nullable (use pointers). nullable := field.Desc.Kind() == protoreflect.MessageKind - - // If we use gogo, the nullability of fields (messages, but also bytes fields with custom types) is controlled with the (gogoproto.nullable) option. - if Params.Lang == "gogo" { - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { - nullable = true - } - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Nullable) { - nullable = proto.GetExtension(field.Desc.Options(), gogoproto.E_Nullable).(bool) - } - } - return nullable } func fieldGoName(field *protogen.Field) interface{} { var fieldGoName interface{} = field.GoName - if Params.Lang == "gogo" { - // If we use gogo, the GoName of a field can be overridden with the (gogoproto.customname) option. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customname) { - fieldGoName = proto.GetExtension(field.Desc.Options(), gogoproto.E_Customname).(string) - } - // Fields with the (gogoproto.embed) option should use the name of the embedded message. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Embed) { - if proto.GetExtension(field.Desc.Options(), gogoproto.E_Embed).(bool) { - fieldGoName = field.Message.GoIdent - } - } - } return fieldGoName } func fieldCustomType(field *protogen.Field) *protogen.GoIdent { - if Params.Lang == "gogo" { - // If we use gogo, the type of a field can be overridden with the (gogoproto.customtype) option. - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { - return parseGoIdent(proto.GetExtension(field.Desc.Options(), gogoproto.E_Customtype).(string)) - } - } return nil } func flagFromCustomType(field *protogen.Field) *protogen.GoIdent { - // We force customtype getter name only if the gogo-proto plugin is enabled. - if Params.Lang == "gogo" { - if proto.HasExtension(field.Desc.Options(), gogoproto.E_Customtype) { - // Retrieve customtype path. - customtype := proto.GetExtension(field.Desc.Options(), gogoproto.E_Customtype).(string) - i := strings.LastIndex(customtype, ".") - // Force custom getter to be of type `/path/to/customtype.Get{CustomType}`. - customGetter := customtype[:i+1] + Params.CustomTypeGetterPrefix + customtype[i+1:] - // Append slice if the field is repeated. - if field.Desc.IsList() { - customGetter += "Slice" - } - customGetter += Params.CustomTypeGetterSuffix - return parseGoIdent(customGetter) - } - } return nil } diff --git a/internal/gen/messages_set.go b/internal/gen/messages_set.go index c7c6a90..1aecfe2 100644 --- a/internal/gen/messages_set.go +++ b/internal/gen/messages_set.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - "github.com/TheThingsIndustries/protoc-gen-go-flags/internal/gogoproto" "google.golang.org/protobuf/compiler/protogen" "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" @@ -657,21 +656,12 @@ nextField: // readWKTValue assigns a different proto field type to a WKT value based on the plugin used. func (g *generator) readWKTValue(field *protogen.Field, message *protogen.Message, fieldName string) string { pluginPackage := golangPluginPackage - if Params.Lang == "gogo" { - pluginPackage = gogoPluginPackage - } switch message.Desc.FullName() { case "google.protobuf.FieldMask": return g.QualifiedGoIdent(pluginPackage.Ident("SetFieldMask(" + fieldName + ")")) case "google.protobuf.Timestamp": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdtime) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdtime).(bool) { - return ifThenElse(fieldIsNullable(field), "&", "") + fieldName - } return g.QualifiedGoIdent(pluginPackage.Ident("SetTimestamp(" + fieldName + ")")) case "google.protobuf.Duration": - if Params.Lang == "gogo" && proto.HasExtension(field.Desc.Options(), gogoproto.E_Stdduration) && proto.GetExtension(field.Desc.Options(), gogoproto.E_Stdduration).(bool) { - return ifThenElse(fieldIsNullable(field), "&", "") + fieldName - } return g.QualifiedGoIdent(pluginPackage.Ident("SetDuration(" + fieldName + ")")) default: g.gen.Error(fmt.Errorf("unsupported WKT %q", message.Desc.FullName())) diff --git a/internal/gogoproto/gogo.pb.go b/internal/gogoproto/gogo.pb.go deleted file mode 100644 index a1cb198..0000000 --- a/internal/gogoproto/gogo.pb.go +++ /dev/null @@ -1,1299 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.0 -// protoc v3.20.1 -// source: internal/gogoproto/gogo.proto - -package gogoproto - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - descriptorpb "google.golang.org/protobuf/types/descriptorpb" - reflect "reflect" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -var file_internal_gogoproto_gogo_proto_extTypes = []protoimpl.ExtensionInfo{ - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62001, - Name: "gogoproto.goproto_enum_prefix", - Tag: "varint,62001,opt,name=goproto_enum_prefix", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62021, - Name: "gogoproto.goproto_enum_stringer", - Tag: "varint,62021,opt,name=goproto_enum_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62022, - Name: "gogoproto.enum_stringer", - Tag: "varint,62022,opt,name=enum_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*string)(nil), - Field: 62023, - Name: "gogoproto.enum_customname", - Tag: "bytes,62023,opt,name=enum_customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 62024, - Name: "gogoproto.enumdecl", - Tag: "varint,62024,opt,name=enumdecl", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.EnumValueOptions)(nil), - ExtensionType: (*string)(nil), - Field: 66001, - Name: "gogoproto.enumvalue_customname", - Tag: "bytes,66001,opt,name=enumvalue_customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63001, - Name: "gogoproto.goproto_getters_all", - Tag: "varint,63001,opt,name=goproto_getters_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63002, - Name: "gogoproto.goproto_enum_prefix_all", - Tag: "varint,63002,opt,name=goproto_enum_prefix_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63003, - Name: "gogoproto.goproto_stringer_all", - Tag: "varint,63003,opt,name=goproto_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63004, - Name: "gogoproto.verbose_equal_all", - Tag: "varint,63004,opt,name=verbose_equal_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63005, - Name: "gogoproto.face_all", - Tag: "varint,63005,opt,name=face_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63006, - Name: "gogoproto.gostring_all", - Tag: "varint,63006,opt,name=gostring_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63007, - Name: "gogoproto.populate_all", - Tag: "varint,63007,opt,name=populate_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63008, - Name: "gogoproto.stringer_all", - Tag: "varint,63008,opt,name=stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63009, - Name: "gogoproto.onlyone_all", - Tag: "varint,63009,opt,name=onlyone_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63013, - Name: "gogoproto.equal_all", - Tag: "varint,63013,opt,name=equal_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63014, - Name: "gogoproto.description_all", - Tag: "varint,63014,opt,name=description_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63015, - Name: "gogoproto.testgen_all", - Tag: "varint,63015,opt,name=testgen_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63016, - Name: "gogoproto.benchgen_all", - Tag: "varint,63016,opt,name=benchgen_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63017, - Name: "gogoproto.marshaler_all", - Tag: "varint,63017,opt,name=marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63018, - Name: "gogoproto.unmarshaler_all", - Tag: "varint,63018,opt,name=unmarshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63019, - Name: "gogoproto.stable_marshaler_all", - Tag: "varint,63019,opt,name=stable_marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63020, - Name: "gogoproto.sizer_all", - Tag: "varint,63020,opt,name=sizer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63021, - Name: "gogoproto.goproto_enum_stringer_all", - Tag: "varint,63021,opt,name=goproto_enum_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63022, - Name: "gogoproto.enum_stringer_all", - Tag: "varint,63022,opt,name=enum_stringer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63023, - Name: "gogoproto.unsafe_marshaler_all", - Tag: "varint,63023,opt,name=unsafe_marshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63024, - Name: "gogoproto.unsafe_unmarshaler_all", - Tag: "varint,63024,opt,name=unsafe_unmarshaler_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63025, - Name: "gogoproto.goproto_extensions_map_all", - Tag: "varint,63025,opt,name=goproto_extensions_map_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63026, - Name: "gogoproto.goproto_unrecognized_all", - Tag: "varint,63026,opt,name=goproto_unrecognized_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63027, - Name: "gogoproto.gogoproto_import", - Tag: "varint,63027,opt,name=gogoproto_import", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63028, - Name: "gogoproto.protosizer_all", - Tag: "varint,63028,opt,name=protosizer_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63029, - Name: "gogoproto.compare_all", - Tag: "varint,63029,opt,name=compare_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63030, - Name: "gogoproto.typedecl_all", - Tag: "varint,63030,opt,name=typedecl_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63031, - Name: "gogoproto.enumdecl_all", - Tag: "varint,63031,opt,name=enumdecl_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63032, - Name: "gogoproto.goproto_registration", - Tag: "varint,63032,opt,name=goproto_registration", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63033, - Name: "gogoproto.messagename_all", - Tag: "varint,63033,opt,name=messagename_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63034, - Name: "gogoproto.goproto_sizecache_all", - Tag: "varint,63034,opt,name=goproto_sizecache_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FileOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 63035, - Name: "gogoproto.goproto_unkeyed_all", - Tag: "varint,63035,opt,name=goproto_unkeyed_all", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64001, - Name: "gogoproto.goproto_getters", - Tag: "varint,64001,opt,name=goproto_getters", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64003, - Name: "gogoproto.goproto_stringer", - Tag: "varint,64003,opt,name=goproto_stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64004, - Name: "gogoproto.verbose_equal", - Tag: "varint,64004,opt,name=verbose_equal", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64005, - Name: "gogoproto.face", - Tag: "varint,64005,opt,name=face", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64006, - Name: "gogoproto.gostring", - Tag: "varint,64006,opt,name=gostring", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64007, - Name: "gogoproto.populate", - Tag: "varint,64007,opt,name=populate", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 67008, - Name: "gogoproto.stringer", - Tag: "varint,67008,opt,name=stringer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64009, - Name: "gogoproto.onlyone", - Tag: "varint,64009,opt,name=onlyone", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64013, - Name: "gogoproto.equal", - Tag: "varint,64013,opt,name=equal", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64014, - Name: "gogoproto.description", - Tag: "varint,64014,opt,name=description", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64015, - Name: "gogoproto.testgen", - Tag: "varint,64015,opt,name=testgen", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64016, - Name: "gogoproto.benchgen", - Tag: "varint,64016,opt,name=benchgen", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64017, - Name: "gogoproto.marshaler", - Tag: "varint,64017,opt,name=marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64018, - Name: "gogoproto.unmarshaler", - Tag: "varint,64018,opt,name=unmarshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64019, - Name: "gogoproto.stable_marshaler", - Tag: "varint,64019,opt,name=stable_marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64020, - Name: "gogoproto.sizer", - Tag: "varint,64020,opt,name=sizer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64023, - Name: "gogoproto.unsafe_marshaler", - Tag: "varint,64023,opt,name=unsafe_marshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64024, - Name: "gogoproto.unsafe_unmarshaler", - Tag: "varint,64024,opt,name=unsafe_unmarshaler", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64025, - Name: "gogoproto.goproto_extensions_map", - Tag: "varint,64025,opt,name=goproto_extensions_map", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64026, - Name: "gogoproto.goproto_unrecognized", - Tag: "varint,64026,opt,name=goproto_unrecognized", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64028, - Name: "gogoproto.protosizer", - Tag: "varint,64028,opt,name=protosizer", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64029, - Name: "gogoproto.compare", - Tag: "varint,64029,opt,name=compare", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64030, - Name: "gogoproto.typedecl", - Tag: "varint,64030,opt,name=typedecl", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64033, - Name: "gogoproto.messagename", - Tag: "varint,64033,opt,name=messagename", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64034, - Name: "gogoproto.goproto_sizecache", - Tag: "varint,64034,opt,name=goproto_sizecache", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.MessageOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 64035, - Name: "gogoproto.goproto_unkeyed", - Tag: "varint,64035,opt,name=goproto_unkeyed", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65001, - Name: "gogoproto.nullable", - Tag: "varint,65001,opt,name=nullable", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65002, - Name: "gogoproto.embed", - Tag: "varint,65002,opt,name=embed", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65003, - Name: "gogoproto.customtype", - Tag: "bytes,65003,opt,name=customtype", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65004, - Name: "gogoproto.customname", - Tag: "bytes,65004,opt,name=customname", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65005, - Name: "gogoproto.jsontag", - Tag: "bytes,65005,opt,name=jsontag", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65006, - Name: "gogoproto.moretags", - Tag: "bytes,65006,opt,name=moretags", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65007, - Name: "gogoproto.casttype", - Tag: "bytes,65007,opt,name=casttype", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65008, - Name: "gogoproto.castkey", - Tag: "bytes,65008,opt,name=castkey", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*string)(nil), - Field: 65009, - Name: "gogoproto.castvalue", - Tag: "bytes,65009,opt,name=castvalue", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65010, - Name: "gogoproto.stdtime", - Tag: "varint,65010,opt,name=stdtime", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65011, - Name: "gogoproto.stdduration", - Tag: "varint,65011,opt,name=stdduration", - Filename: "internal/gogoproto/gogo.proto", - }, - { - ExtendedType: (*descriptorpb.FieldOptions)(nil), - ExtensionType: (*bool)(nil), - Field: 65012, - Name: "gogoproto.wktpointer", - Tag: "varint,65012,opt,name=wktpointer", - Filename: "internal/gogoproto/gogo.proto", - }, -} - -// Extension fields to descriptorpb.EnumOptions. -var ( - // optional bool goproto_enum_prefix = 62001; - E_GoprotoEnumPrefix = &file_internal_gogoproto_gogo_proto_extTypes[0] - // optional bool goproto_enum_stringer = 62021; - E_GoprotoEnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[1] - // optional bool enum_stringer = 62022; - E_EnumStringer = &file_internal_gogoproto_gogo_proto_extTypes[2] - // optional string enum_customname = 62023; - E_EnumCustomname = &file_internal_gogoproto_gogo_proto_extTypes[3] - // optional bool enumdecl = 62024; - E_Enumdecl = &file_internal_gogoproto_gogo_proto_extTypes[4] -) - -// Extension fields to descriptorpb.EnumValueOptions. -var ( - // optional string enumvalue_customname = 66001; - E_EnumvalueCustomname = &file_internal_gogoproto_gogo_proto_extTypes[5] -) - -// Extension fields to descriptorpb.FileOptions. -var ( - // optional bool goproto_getters_all = 63001; - E_GoprotoGettersAll = &file_internal_gogoproto_gogo_proto_extTypes[6] - // optional bool goproto_enum_prefix_all = 63002; - E_GoprotoEnumPrefixAll = &file_internal_gogoproto_gogo_proto_extTypes[7] - // optional bool goproto_stringer_all = 63003; - E_GoprotoStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[8] - // optional bool verbose_equal_all = 63004; - E_VerboseEqualAll = &file_internal_gogoproto_gogo_proto_extTypes[9] - // optional bool face_all = 63005; - E_FaceAll = &file_internal_gogoproto_gogo_proto_extTypes[10] - // optional bool gostring_all = 63006; - E_GostringAll = &file_internal_gogoproto_gogo_proto_extTypes[11] - // optional bool populate_all = 63007; - E_PopulateAll = &file_internal_gogoproto_gogo_proto_extTypes[12] - // optional bool stringer_all = 63008; - E_StringerAll = &file_internal_gogoproto_gogo_proto_extTypes[13] - // optional bool onlyone_all = 63009; - E_OnlyoneAll = &file_internal_gogoproto_gogo_proto_extTypes[14] - // optional bool equal_all = 63013; - E_EqualAll = &file_internal_gogoproto_gogo_proto_extTypes[15] - // optional bool description_all = 63014; - E_DescriptionAll = &file_internal_gogoproto_gogo_proto_extTypes[16] - // optional bool testgen_all = 63015; - E_TestgenAll = &file_internal_gogoproto_gogo_proto_extTypes[17] - // optional bool benchgen_all = 63016; - E_BenchgenAll = &file_internal_gogoproto_gogo_proto_extTypes[18] - // optional bool marshaler_all = 63017; - E_MarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[19] - // optional bool unmarshaler_all = 63018; - E_UnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[20] - // optional bool stable_marshaler_all = 63019; - E_StableMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[21] - // optional bool sizer_all = 63020; - E_SizerAll = &file_internal_gogoproto_gogo_proto_extTypes[22] - // optional bool goproto_enum_stringer_all = 63021; - E_GoprotoEnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[23] - // optional bool enum_stringer_all = 63022; - E_EnumStringerAll = &file_internal_gogoproto_gogo_proto_extTypes[24] - // optional bool unsafe_marshaler_all = 63023; - E_UnsafeMarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[25] - // optional bool unsafe_unmarshaler_all = 63024; - E_UnsafeUnmarshalerAll = &file_internal_gogoproto_gogo_proto_extTypes[26] - // optional bool goproto_extensions_map_all = 63025; - E_GoprotoExtensionsMapAll = &file_internal_gogoproto_gogo_proto_extTypes[27] - // optional bool goproto_unrecognized_all = 63026; - E_GoprotoUnrecognizedAll = &file_internal_gogoproto_gogo_proto_extTypes[28] - // optional bool gogoproto_import = 63027; - E_GogoprotoImport = &file_internal_gogoproto_gogo_proto_extTypes[29] - // optional bool protosizer_all = 63028; - E_ProtosizerAll = &file_internal_gogoproto_gogo_proto_extTypes[30] - // optional bool compare_all = 63029; - E_CompareAll = &file_internal_gogoproto_gogo_proto_extTypes[31] - // optional bool typedecl_all = 63030; - E_TypedeclAll = &file_internal_gogoproto_gogo_proto_extTypes[32] - // optional bool enumdecl_all = 63031; - E_EnumdeclAll = &file_internal_gogoproto_gogo_proto_extTypes[33] - // optional bool goproto_registration = 63032; - E_GoprotoRegistration = &file_internal_gogoproto_gogo_proto_extTypes[34] - // optional bool messagename_all = 63033; - E_MessagenameAll = &file_internal_gogoproto_gogo_proto_extTypes[35] - // optional bool goproto_sizecache_all = 63034; - E_GoprotoSizecacheAll = &file_internal_gogoproto_gogo_proto_extTypes[36] - // optional bool goproto_unkeyed_all = 63035; - E_GoprotoUnkeyedAll = &file_internal_gogoproto_gogo_proto_extTypes[37] -) - -// Extension fields to descriptorpb.MessageOptions. -var ( - // optional bool goproto_getters = 64001; - E_GoprotoGetters = &file_internal_gogoproto_gogo_proto_extTypes[38] - // optional bool goproto_stringer = 64003; - E_GoprotoStringer = &file_internal_gogoproto_gogo_proto_extTypes[39] - // optional bool verbose_equal = 64004; - E_VerboseEqual = &file_internal_gogoproto_gogo_proto_extTypes[40] - // optional bool face = 64005; - E_Face = &file_internal_gogoproto_gogo_proto_extTypes[41] - // optional bool gostring = 64006; - E_Gostring = &file_internal_gogoproto_gogo_proto_extTypes[42] - // optional bool populate = 64007; - E_Populate = &file_internal_gogoproto_gogo_proto_extTypes[43] - // optional bool stringer = 67008; - E_Stringer = &file_internal_gogoproto_gogo_proto_extTypes[44] - // optional bool onlyone = 64009; - E_Onlyone = &file_internal_gogoproto_gogo_proto_extTypes[45] - // optional bool equal = 64013; - E_Equal = &file_internal_gogoproto_gogo_proto_extTypes[46] - // optional bool description = 64014; - E_Description = &file_internal_gogoproto_gogo_proto_extTypes[47] - // optional bool testgen = 64015; - E_Testgen = &file_internal_gogoproto_gogo_proto_extTypes[48] - // optional bool benchgen = 64016; - E_Benchgen = &file_internal_gogoproto_gogo_proto_extTypes[49] - // optional bool marshaler = 64017; - E_Marshaler = &file_internal_gogoproto_gogo_proto_extTypes[50] - // optional bool unmarshaler = 64018; - E_Unmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[51] - // optional bool stable_marshaler = 64019; - E_StableMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[52] - // optional bool sizer = 64020; - E_Sizer = &file_internal_gogoproto_gogo_proto_extTypes[53] - // optional bool unsafe_marshaler = 64023; - E_UnsafeMarshaler = &file_internal_gogoproto_gogo_proto_extTypes[54] - // optional bool unsafe_unmarshaler = 64024; - E_UnsafeUnmarshaler = &file_internal_gogoproto_gogo_proto_extTypes[55] - // optional bool goproto_extensions_map = 64025; - E_GoprotoExtensionsMap = &file_internal_gogoproto_gogo_proto_extTypes[56] - // optional bool goproto_unrecognized = 64026; - E_GoprotoUnrecognized = &file_internal_gogoproto_gogo_proto_extTypes[57] - // optional bool protosizer = 64028; - E_Protosizer = &file_internal_gogoproto_gogo_proto_extTypes[58] - // optional bool compare = 64029; - E_Compare = &file_internal_gogoproto_gogo_proto_extTypes[59] - // optional bool typedecl = 64030; - E_Typedecl = &file_internal_gogoproto_gogo_proto_extTypes[60] - // optional bool messagename = 64033; - E_Messagename = &file_internal_gogoproto_gogo_proto_extTypes[61] - // optional bool goproto_sizecache = 64034; - E_GoprotoSizecache = &file_internal_gogoproto_gogo_proto_extTypes[62] - // optional bool goproto_unkeyed = 64035; - E_GoprotoUnkeyed = &file_internal_gogoproto_gogo_proto_extTypes[63] -) - -// Extension fields to descriptorpb.FieldOptions. -var ( - // optional bool nullable = 65001; - E_Nullable = &file_internal_gogoproto_gogo_proto_extTypes[64] - // optional bool embed = 65002; - E_Embed = &file_internal_gogoproto_gogo_proto_extTypes[65] - // optional string customtype = 65003; - E_Customtype = &file_internal_gogoproto_gogo_proto_extTypes[66] - // optional string customname = 65004; - E_Customname = &file_internal_gogoproto_gogo_proto_extTypes[67] - // optional string jsontag = 65005; - E_Jsontag = &file_internal_gogoproto_gogo_proto_extTypes[68] - // optional string moretags = 65006; - E_Moretags = &file_internal_gogoproto_gogo_proto_extTypes[69] - // optional string casttype = 65007; - E_Casttype = &file_internal_gogoproto_gogo_proto_extTypes[70] - // optional string castkey = 65008; - E_Castkey = &file_internal_gogoproto_gogo_proto_extTypes[71] - // optional string castvalue = 65009; - E_Castvalue = &file_internal_gogoproto_gogo_proto_extTypes[72] - // optional bool stdtime = 65010; - E_Stdtime = &file_internal_gogoproto_gogo_proto_extTypes[73] - // optional bool stdduration = 65011; - E_Stdduration = &file_internal_gogoproto_gogo_proto_extTypes[74] - // optional bool wktpointer = 65012; - E_Wktpointer = &file_internal_gogoproto_gogo_proto_extTypes[75] -) - -var File_internal_gogoproto_gogo_proto protoreflect.FileDescriptor - -var file_internal_gogoproto_gogo_proto_rawDesc = []byte{ - 0x0a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, - 0x09, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x65, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x3a, 0x4e, 0x0a, 0x13, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, - 0x66, 0x69, 0x78, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xb1, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x3a, 0x52, 0x0a, 0x15, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xc5, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, - 0x3a, 0x43, 0x0a, 0x0d, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, - 0x72, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0xc6, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x47, 0x0a, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc7, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, - 0x65, 0x6e, 0x75, 0x6d, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x3a, 0x3a, - 0x0a, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, - 0x6d, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc8, 0xe4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x56, 0x0a, 0x14, 0x65, 0x6e, - 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x21, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xd1, 0x83, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, - 0x6e, 0x75, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, - 0x6d, 0x65, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, - 0x74, 0x74, 0x65, 0x72, 0x73, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x41, - 0x6c, 0x6c, 0x3a, 0x55, 0x0a, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x6e, - 0x75, 0x6d, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x69, 0x78, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, 0xec, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x6e, 0x75, 0x6d, - 0x50, 0x72, 0x65, 0x66, 0x69, 0x78, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, - 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x9b, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x11, 0x76, - 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x39, 0x0a, 0x08, 0x66, 0x61, 0x63, 0x65, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x9d, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x66, 0x61, 0x63, 0x65, 0x41, - 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x61, - 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x9e, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, - 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x9f, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x70, 0x6f, 0x70, - 0x75, 0x6c, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, - 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x6f, - 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x6f, 0x6e, 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, - 0x65, 0x71, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x64, 0x65, 0x73, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa6, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0e, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x41, - 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x5f, 0x61, 0x6c, - 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0xa7, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, - 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xa8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x62, 0x65, 0x6e, 0x63, 0x68, - 0x67, 0x65, 0x6e, 0x41, 0x6c, 0x6c, 0x3a, 0x43, 0x0a, 0x0d, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x47, 0x0a, 0x0f, 0x75, - 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xaa, 0xec, 0x03, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, - 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x6d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xab, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x12, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3b, 0x0a, 0x09, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xac, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x73, 0x69, 0x7a, 0x65, 0x72, - 0x41, 0x6c, 0x6c, 0x3a, 0x59, 0x0a, 0x19, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, - 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xad, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, - 0x6e, 0x75, 0x6d, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x4a, - 0x0a, 0x11, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x5f, - 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0xae, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x65, 0x6e, 0x75, 0x6d, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x50, 0x0a, 0x14, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x5f, 0x61, - 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xaf, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x12, 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, - 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x54, 0x0a, 0x16, - 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb0, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x14, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x41, - 0x6c, 0x6c, 0x3a, 0x5b, 0x0a, 0x1a, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, - 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x5f, 0x61, 0x6c, 0x6c, - 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb1, - 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x17, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, - 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x41, 0x6c, 0x6c, 0x3a, - 0x58, 0x0a, 0x18, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, - 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb2, 0xec, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x16, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x72, 0x65, 0x63, 0x6f, - 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x6c, 0x6c, 0x3a, 0x49, 0x0a, 0x10, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x69, 0x6d, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1c, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb3, 0xec, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x49, 0x6d, - 0x70, 0x6f, 0x72, 0x74, 0x3a, 0x45, 0x0a, 0x0e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, - 0x65, 0x72, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb4, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x41, 0x6c, 0x6c, 0x3a, 0x3f, 0x0a, 0x0b, 0x63, - 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb5, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x0a, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x41, 0x0a, 0x0c, - 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb6, 0xec, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x41, 0x6c, 0x6c, 0x3a, - 0x41, 0x0a, 0x0c, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x5f, 0x61, 0x6c, 0x6c, 0x12, - 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb7, 0xec, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x64, 0x65, 0x63, 0x6c, 0x41, - 0x6c, 0x6c, 0x3a, 0x51, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x72, 0x65, - 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb8, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x47, 0x0a, 0x0f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xb9, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x41, 0x6c, 0x6c, 0x3a, 0x52, - 0x0a, 0x15, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, 0x61, - 0x63, 0x68, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xba, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x41, - 0x6c, 0x6c, 0x3a, 0x4e, 0x0a, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, - 0x6b, 0x65, 0x79, 0x65, 0x64, 0x5f, 0x61, 0x6c, 0x6c, 0x12, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x6c, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xbb, 0xec, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x41, - 0x6c, 0x6c, 0x3a, 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x67, 0x65, - 0x74, 0x74, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x81, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x47, 0x65, 0x74, 0x74, 0x65, 0x72, 0x73, 0x3a, 0x4c, - 0x0a, 0x10, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, - 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0x83, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x46, 0x0a, 0x0d, - 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x5f, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x84, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x76, 0x65, 0x72, 0x62, 0x6f, 0x73, 0x65, 0x45, - 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x35, 0x0a, 0x04, 0x66, 0x61, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x85, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x04, 0x66, 0x61, 0x63, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x67, - 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x86, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x67, 0x6f, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x3a, 0x3d, 0x0a, 0x08, 0x70, 0x6f, - 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x87, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x08, 0x70, 0x6f, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x73, 0x74, 0x72, - 0x69, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xc0, 0x8b, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x65, 0x72, 0x3a, 0x3b, 0x0a, 0x07, 0x6f, 0x6e, 0x6c, 0x79, - 0x6f, 0x6e, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x89, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x6f, 0x6e, - 0x6c, 0x79, 0x6f, 0x6e, 0x65, 0x3a, 0x37, 0x0a, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x12, 0x1f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x8d, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x3a, 0x43, - 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x8e, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x3a, 0x3b, 0x0a, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, 0x12, 0x1f, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, - 0x8f, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x74, 0x65, 0x73, 0x74, 0x67, 0x65, 0x6e, - 0x3a, 0x3d, 0x0a, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x90, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x62, 0x65, 0x6e, 0x63, 0x68, 0x67, 0x65, 0x6e, 0x3a, - 0x3f, 0x0a, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x91, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x3a, 0x43, 0x0a, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, - 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, - 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0x92, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, - 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x5f, - 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x93, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x73, 0x74, 0x61, 0x62, 0x6c, 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, - 0x6c, 0x65, 0x72, 0x3a, 0x37, 0x0a, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x94, 0xf4, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x4c, 0x0a, 0x10, - 0x75, 0x6e, 0x73, 0x61, 0x66, 0x65, 0x5f, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x97, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0f, 0x75, 0x6e, 0x73, 0x61, 0x66, - 0x65, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x50, 0x0a, 0x12, 0x75, 0x6e, - 0x73, 0x61, 0x66, 0x65, 0x5f, 0x75, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x73, 0x18, 0x98, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x11, 0x75, 0x6e, 0x73, 0x61, 0x66, - 0x65, 0x55, 0x6e, 0x6d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x3a, 0x57, 0x0a, 0x16, - 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x5f, 0x6d, 0x61, 0x70, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x99, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, - 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x73, 0x4d, 0x61, 0x70, 0x3a, 0x54, 0x0a, 0x14, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x5f, 0x75, 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x12, 0x1f, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9a, - 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x13, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x55, - 0x6e, 0x72, 0x65, 0x63, 0x6f, 0x67, 0x6e, 0x69, 0x7a, 0x65, 0x64, 0x3a, 0x41, 0x0a, 0x0a, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9c, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x69, 0x7a, 0x65, 0x72, 0x3a, 0x3b, - 0x0a, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9d, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x72, 0x65, 0x3a, 0x3d, 0x0a, 0x08, 0x74, - 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x9e, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, - 0x52, 0x08, 0x74, 0x79, 0x70, 0x65, 0x64, 0x65, 0x63, 0x6c, 0x3a, 0x43, 0x0a, 0x0b, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, - 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa1, 0xf4, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0b, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x3a, - 0x4e, 0x0a, 0x11, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x63, - 0x61, 0x63, 0x68, 0x65, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xa2, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x10, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x53, 0x69, 0x7a, 0x65, 0x63, 0x61, 0x63, 0x68, 0x65, 0x3a, - 0x4a, 0x0a, 0x0f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x5f, 0x75, 0x6e, 0x6b, 0x65, 0x79, - 0x65, 0x64, 0x12, 0x1f, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x4f, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x18, 0xa3, 0xf4, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, 0x67, 0x6f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x55, 0x6e, 0x6b, 0x65, 0x79, 0x65, 0x64, 0x3a, 0x3b, 0x0a, 0x08, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xe9, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x3a, 0x35, 0x0a, 0x05, 0x65, 0x6d, 0x62, 0x65, - 0x64, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xea, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x65, 0x6d, 0x62, 0x65, 0x64, 0x3a, - 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xeb, 0xfb, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x74, 0x79, 0x70, 0x65, - 0x3a, 0x3f, 0x0a, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xec, 0xfb, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x6e, 0x61, 0x6d, - 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x12, 0x1d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xed, 0xfb, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x07, 0x6a, 0x73, 0x6f, 0x6e, 0x74, 0x61, 0x67, 0x3a, 0x3b, 0x0a, 0x08, - 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, - 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, - 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xee, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x6d, 0x6f, 0x72, 0x65, 0x74, 0x61, 0x67, 0x73, 0x3a, 0x3b, 0x0a, 0x08, 0x63, 0x61, 0x73, - 0x74, 0x74, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xef, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x61, - 0x73, 0x74, 0x74, 0x79, 0x70, 0x65, 0x3a, 0x39, 0x0a, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, - 0x79, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x18, 0xf0, 0xfb, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x61, 0x73, 0x74, 0x6b, 0x65, - 0x79, 0x3a, 0x3d, 0x0a, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x1d, - 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf1, 0xfb, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x63, 0x61, 0x73, 0x74, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x39, 0x0a, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1d, 0x2e, 0x67, 0x6f, - 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, - 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf2, 0xfb, 0x03, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x07, 0x73, 0x74, 0x64, 0x74, 0x69, 0x6d, 0x65, 0x3a, 0x41, 0x0a, 0x0b, 0x73, - 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, - 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf3, 0xfb, 0x03, 0x20, 0x01, 0x28, - 0x08, 0x52, 0x0b, 0x73, 0x74, 0x64, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3f, - 0x0a, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x12, 0x1d, 0x2e, 0x67, - 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, - 0x69, 0x65, 0x6c, 0x64, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xf4, 0xfb, 0x03, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0a, 0x77, 0x6b, 0x74, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x42, - 0x45, 0x0a, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x42, 0x0a, 0x47, 0x6f, 0x47, 0x6f, 0x50, 0x72, 0x6f, 0x74, - 0x6f, 0x73, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x67, - 0x6f, 0x67, 0x6f, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, -} - -var file_internal_gogoproto_gogo_proto_goTypes = []interface{}{ - (*descriptorpb.EnumOptions)(nil), // 0: google.protobuf.EnumOptions - (*descriptorpb.EnumValueOptions)(nil), // 1: google.protobuf.EnumValueOptions - (*descriptorpb.FileOptions)(nil), // 2: google.protobuf.FileOptions - (*descriptorpb.MessageOptions)(nil), // 3: google.protobuf.MessageOptions - (*descriptorpb.FieldOptions)(nil), // 4: google.protobuf.FieldOptions -} -var file_internal_gogoproto_gogo_proto_depIdxs = []int32{ - 0, // 0: gogoproto.goproto_enum_prefix:extendee -> google.protobuf.EnumOptions - 0, // 1: gogoproto.goproto_enum_stringer:extendee -> google.protobuf.EnumOptions - 0, // 2: gogoproto.enum_stringer:extendee -> google.protobuf.EnumOptions - 0, // 3: gogoproto.enum_customname:extendee -> google.protobuf.EnumOptions - 0, // 4: gogoproto.enumdecl:extendee -> google.protobuf.EnumOptions - 1, // 5: gogoproto.enumvalue_customname:extendee -> google.protobuf.EnumValueOptions - 2, // 6: gogoproto.goproto_getters_all:extendee -> google.protobuf.FileOptions - 2, // 7: gogoproto.goproto_enum_prefix_all:extendee -> google.protobuf.FileOptions - 2, // 8: gogoproto.goproto_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 9: gogoproto.verbose_equal_all:extendee -> google.protobuf.FileOptions - 2, // 10: gogoproto.face_all:extendee -> google.protobuf.FileOptions - 2, // 11: gogoproto.gostring_all:extendee -> google.protobuf.FileOptions - 2, // 12: gogoproto.populate_all:extendee -> google.protobuf.FileOptions - 2, // 13: gogoproto.stringer_all:extendee -> google.protobuf.FileOptions - 2, // 14: gogoproto.onlyone_all:extendee -> google.protobuf.FileOptions - 2, // 15: gogoproto.equal_all:extendee -> google.protobuf.FileOptions - 2, // 16: gogoproto.description_all:extendee -> google.protobuf.FileOptions - 2, // 17: gogoproto.testgen_all:extendee -> google.protobuf.FileOptions - 2, // 18: gogoproto.benchgen_all:extendee -> google.protobuf.FileOptions - 2, // 19: gogoproto.marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 20: gogoproto.unmarshaler_all:extendee -> google.protobuf.FileOptions - 2, // 21: gogoproto.stable_marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 22: gogoproto.sizer_all:extendee -> google.protobuf.FileOptions - 2, // 23: gogoproto.goproto_enum_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 24: gogoproto.enum_stringer_all:extendee -> google.protobuf.FileOptions - 2, // 25: gogoproto.unsafe_marshaler_all:extendee -> google.protobuf.FileOptions - 2, // 26: gogoproto.unsafe_unmarshaler_all:extendee -> google.protobuf.FileOptions - 2, // 27: gogoproto.goproto_extensions_map_all:extendee -> google.protobuf.FileOptions - 2, // 28: gogoproto.goproto_unrecognized_all:extendee -> google.protobuf.FileOptions - 2, // 29: gogoproto.gogoproto_import:extendee -> google.protobuf.FileOptions - 2, // 30: gogoproto.protosizer_all:extendee -> google.protobuf.FileOptions - 2, // 31: gogoproto.compare_all:extendee -> google.protobuf.FileOptions - 2, // 32: gogoproto.typedecl_all:extendee -> google.protobuf.FileOptions - 2, // 33: gogoproto.enumdecl_all:extendee -> google.protobuf.FileOptions - 2, // 34: gogoproto.goproto_registration:extendee -> google.protobuf.FileOptions - 2, // 35: gogoproto.messagename_all:extendee -> google.protobuf.FileOptions - 2, // 36: gogoproto.goproto_sizecache_all:extendee -> google.protobuf.FileOptions - 2, // 37: gogoproto.goproto_unkeyed_all:extendee -> google.protobuf.FileOptions - 3, // 38: gogoproto.goproto_getters:extendee -> google.protobuf.MessageOptions - 3, // 39: gogoproto.goproto_stringer:extendee -> google.protobuf.MessageOptions - 3, // 40: gogoproto.verbose_equal:extendee -> google.protobuf.MessageOptions - 3, // 41: gogoproto.face:extendee -> google.protobuf.MessageOptions - 3, // 42: gogoproto.gostring:extendee -> google.protobuf.MessageOptions - 3, // 43: gogoproto.populate:extendee -> google.protobuf.MessageOptions - 3, // 44: gogoproto.stringer:extendee -> google.protobuf.MessageOptions - 3, // 45: gogoproto.onlyone:extendee -> google.protobuf.MessageOptions - 3, // 46: gogoproto.equal:extendee -> google.protobuf.MessageOptions - 3, // 47: gogoproto.description:extendee -> google.protobuf.MessageOptions - 3, // 48: gogoproto.testgen:extendee -> google.protobuf.MessageOptions - 3, // 49: gogoproto.benchgen:extendee -> google.protobuf.MessageOptions - 3, // 50: gogoproto.marshaler:extendee -> google.protobuf.MessageOptions - 3, // 51: gogoproto.unmarshaler:extendee -> google.protobuf.MessageOptions - 3, // 52: gogoproto.stable_marshaler:extendee -> google.protobuf.MessageOptions - 3, // 53: gogoproto.sizer:extendee -> google.protobuf.MessageOptions - 3, // 54: gogoproto.unsafe_marshaler:extendee -> google.protobuf.MessageOptions - 3, // 55: gogoproto.unsafe_unmarshaler:extendee -> google.protobuf.MessageOptions - 3, // 56: gogoproto.goproto_extensions_map:extendee -> google.protobuf.MessageOptions - 3, // 57: gogoproto.goproto_unrecognized:extendee -> google.protobuf.MessageOptions - 3, // 58: gogoproto.protosizer:extendee -> google.protobuf.MessageOptions - 3, // 59: gogoproto.compare:extendee -> google.protobuf.MessageOptions - 3, // 60: gogoproto.typedecl:extendee -> google.protobuf.MessageOptions - 3, // 61: gogoproto.messagename:extendee -> google.protobuf.MessageOptions - 3, // 62: gogoproto.goproto_sizecache:extendee -> google.protobuf.MessageOptions - 3, // 63: gogoproto.goproto_unkeyed:extendee -> google.protobuf.MessageOptions - 4, // 64: gogoproto.nullable:extendee -> google.protobuf.FieldOptions - 4, // 65: gogoproto.embed:extendee -> google.protobuf.FieldOptions - 4, // 66: gogoproto.customtype:extendee -> google.protobuf.FieldOptions - 4, // 67: gogoproto.customname:extendee -> google.protobuf.FieldOptions - 4, // 68: gogoproto.jsontag:extendee -> google.protobuf.FieldOptions - 4, // 69: gogoproto.moretags:extendee -> google.protobuf.FieldOptions - 4, // 70: gogoproto.casttype:extendee -> google.protobuf.FieldOptions - 4, // 71: gogoproto.castkey:extendee -> google.protobuf.FieldOptions - 4, // 72: gogoproto.castvalue:extendee -> google.protobuf.FieldOptions - 4, // 73: gogoproto.stdtime:extendee -> google.protobuf.FieldOptions - 4, // 74: gogoproto.stdduration:extendee -> google.protobuf.FieldOptions - 4, // 75: gogoproto.wktpointer:extendee -> google.protobuf.FieldOptions - 76, // [76:76] is the sub-list for method output_type - 76, // [76:76] is the sub-list for method input_type - 76, // [76:76] is the sub-list for extension type_name - 0, // [0:76] is the sub-list for extension extendee - 0, // [0:0] is the sub-list for field type_name -} - -func init() { file_internal_gogoproto_gogo_proto_init() } -func file_internal_gogoproto_gogo_proto_init() { - if File_internal_gogoproto_gogo_proto != nil { - return - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_internal_gogoproto_gogo_proto_rawDesc, - NumEnums: 0, - NumMessages: 0, - NumExtensions: 76, - NumServices: 0, - }, - GoTypes: file_internal_gogoproto_gogo_proto_goTypes, - DependencyIndexes: file_internal_gogoproto_gogo_proto_depIdxs, - ExtensionInfos: file_internal_gogoproto_gogo_proto_extTypes, - }.Build() - File_internal_gogoproto_gogo_proto = out.File - file_internal_gogoproto_gogo_proto_rawDesc = nil - file_internal_gogoproto_gogo_proto_goTypes = nil - file_internal_gogoproto_gogo_proto_depIdxs = nil -} diff --git a/internal/gogoproto/gogo.proto b/internal/gogoproto/gogo.proto deleted file mode 100644 index a18a859..0000000 --- a/internal/gogoproto/gogo.proto +++ /dev/null @@ -1,143 +0,0 @@ -// Protocol Buffers for Go with Gadgets -// -// Copyright (c) 2013, The GoGo Authors. All rights reserved. -// http://github.com/gogo/protobuf -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// * Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// * Redistributions in binary form must reproduce the above -// copyright notice, this list of conditions and the following disclaimer -// in the documentation and/or other materials provided with the -// distribution. -// -// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -syntax = "proto2"; -package gogoproto; - -import "google/protobuf/descriptor.proto"; - -option java_package = "com.google.protobuf"; -option java_outer_classname = "GoGoProtos"; -option go_package = "github.com/gogo/protobuf/gogoproto"; - -extend google.protobuf.EnumOptions { - optional bool goproto_enum_prefix = 62001; - optional bool goproto_enum_stringer = 62021; - optional bool enum_stringer = 62022; - optional string enum_customname = 62023; - optional bool enumdecl = 62024; -} - -extend google.protobuf.EnumValueOptions { - optional string enumvalue_customname = 66001; -} - -extend google.protobuf.FileOptions { - optional bool goproto_getters_all = 63001; - optional bool goproto_enum_prefix_all = 63002; - optional bool goproto_stringer_all = 63003; - optional bool verbose_equal_all = 63004; - optional bool face_all = 63005; - optional bool gostring_all = 63006; - optional bool populate_all = 63007; - optional bool stringer_all = 63008; - optional bool onlyone_all = 63009; - - optional bool equal_all = 63013; - optional bool description_all = 63014; - optional bool testgen_all = 63015; - optional bool benchgen_all = 63016; - optional bool marshaler_all = 63017; - optional bool unmarshaler_all = 63018; - optional bool stable_marshaler_all = 63019; - - optional bool sizer_all = 63020; - - optional bool goproto_enum_stringer_all = 63021; - optional bool enum_stringer_all = 63022; - - optional bool unsafe_marshaler_all = 63023; - optional bool unsafe_unmarshaler_all = 63024; - - optional bool goproto_extensions_map_all = 63025; - optional bool goproto_unrecognized_all = 63026; - optional bool gogoproto_import = 63027; - optional bool protosizer_all = 63028; - optional bool compare_all = 63029; - optional bool typedecl_all = 63030; - optional bool enumdecl_all = 63031; - - optional bool goproto_registration = 63032; - optional bool messagename_all = 63033; - - optional bool goproto_sizecache_all = 63034; - optional bool goproto_unkeyed_all = 63035; -} - -extend google.protobuf.MessageOptions { - optional bool goproto_getters = 64001; - optional bool goproto_stringer = 64003; - optional bool verbose_equal = 64004; - optional bool face = 64005; - optional bool gostring = 64006; - optional bool populate = 64007; - optional bool stringer = 67008; - optional bool onlyone = 64009; - - optional bool equal = 64013; - optional bool description = 64014; - optional bool testgen = 64015; - optional bool benchgen = 64016; - optional bool marshaler = 64017; - optional bool unmarshaler = 64018; - optional bool stable_marshaler = 64019; - - optional bool sizer = 64020; - - optional bool unsafe_marshaler = 64023; - optional bool unsafe_unmarshaler = 64024; - - optional bool goproto_extensions_map = 64025; - optional bool goproto_unrecognized = 64026; - - optional bool protosizer = 64028; - optional bool compare = 64029; - - optional bool typedecl = 64030; - - optional bool messagename = 64033; - - optional bool goproto_sizecache = 64034; - optional bool goproto_unkeyed = 64035; -} - -extend google.protobuf.FieldOptions { - optional bool nullable = 65001; - optional bool embed = 65002; - optional string customtype = 65003; - optional string customname = 65004; - optional string jsontag = 65005; - optional string moretags = 65006; - optional string casttype = 65007; - optional string castkey = 65008; - optional string castvalue = 65009; - - optional bool stdtime = 65010; - optional bool stdduration = 65011; - optional bool wktpointer = 65012; -} diff --git a/test/enums.proto b/test/enums.proto index 51688c9..29b9a8a 100644 --- a/test/enums.proto +++ b/test/enums.proto @@ -4,19 +4,12 @@ syntax = "proto3"; import "annotations.proto"; -import "internal/gogoproto/gogo.proto"; package thethings.flags.test; option go_package = "github.com/TheThingsIndustries/protoc-gen-go-flags/test"; -option (gogoproto.enum_stringer_all) = true; -option (gogoproto.goproto_enum_stringer_all) = false; - enum RegularEnum { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_stringer) = false; - REGULAR_UNKNOWN = 0; REGULAR_A = 1; @@ -24,8 +17,8 @@ enum RegularEnum { } enum CustomEnum { - option (thethings.flags.enum) = { - alias_map: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/enum.CustomEnum_customvalue" + option (thethings.flags.enum) = { + alias_map: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/enum.CustomEnum_customvalue" }; CUSTOM_UNKNOWN = 0; @@ -61,26 +54,3 @@ message MessageWithOneofEnums { CustomEnumValue wrapped_custom = 3; } } - -message MessageWithEmbeddedMessageDefinitionWithEnums { - option (thethings.flags.message) = { select: true, set: true }; - - message EmbeddedMessageDefinitionWithEnum { - option (thethings.flags.message) = { select: true, set: true }; - - string string_value = 1; - enum EmbeddedEnum { - option (gogoproto.goproto_enum_prefix) = false; - option (gogoproto.enum_stringer) = false; - - AT_MOST_ONCE = 0; - AT_LEAST_ONCE = 1; - EXACTLY_ONCE = 2; - } - - EmbeddedEnum test_enum_value = 2; - EmbeddedEnum test_another_enum_value = 3; - } - - EmbeddedMessageDefinitionWithEnum test_message_field = 1; -} diff --git a/test/gogo.proto b/test/gogo.proto deleted file mode 100644 index 0328d86..0000000 --- a/test/gogo.proto +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -syntax = "proto3"; - -import "annotations.proto"; -import "internal/gogoproto/gogo.proto"; - -import "google/protobuf/duration.proto"; -import "google/protobuf/timestamp.proto"; - -package thethings.flags.test; - -option go_package = "github.com/TheThingsIndustries/protoc-gen-go-flags/test"; - -message MessageWithGoGoOptions { - option (thethings.flags.message) = { select: true, set: true }; - - bytes eui_with_custom_name = 1 [ - (gogoproto.customname) = "EUIWithCustomName" - ]; - - bytes eui_with_custom_name_and_type = 2 [ - (gogoproto.customname) = "EUIWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64", - (thethings.flags.field) = { - set_flag_new_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.New8BytesFlag", - set_flag_getter_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.GetExactBytes" - } - ]; - - bytes non_nullable_eui_with_custom_name_and_type = 3 [ - (gogoproto.customname) = "NonNullableEUIWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64", - (gogoproto.nullable) = false, - (thethings.flags.field) = { - set_flag_new_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.New8BytesFlag", - set_flag_getter_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.GetExactBytes" - } - ]; - - repeated bytes euis_with_custom_name_and_type = 4 [ - (gogoproto.customname) = "EUIsWithCustomNameAndType", - (gogoproto.customtype) = "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64", - (thethings.flags.field) = { - set_flag_new_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.New8BytesSliceFlag", - set_flag_getter_func: "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.GetExactBytesSlice" - } - ]; - - google.protobuf.Duration duration = 5 [(gogoproto.stdduration) = true]; - google.protobuf.Duration non_nullable_duration = 6 [(gogoproto.nullable) = false, (gogoproto.stdduration) = true]; - - google.protobuf.Timestamp timestamp = 7 [(gogoproto.stdtime) = true]; - google.protobuf.Timestamp non_nullable_timestamp = 8 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; -} - -message SubMessage { - option (thethings.flags.message) = { select: true, set: true }; - - string field = 1; -} - -message SubMessageWithoutMarshalers { - option (thethings.flags.message) = { select: true, set: true }; - - string other_field = 1; -} - -message MessageWithNullable { - option (thethings.flags.message) = { select: true, set: true }; - - SubMessage sub = 1 [ - (gogoproto.nullable) = false - ]; - repeated SubMessage subs = 2 [ - (gogoproto.nullable) = false - ]; - - SubMessageWithoutMarshalers other_sub = 3 [ - (gogoproto.nullable) = false - ]; - repeated SubMessageWithoutMarshalers other_subs = 4 [ - (gogoproto.nullable) = false - ]; -} - -message MessageWithEmbedded{ - option (thethings.flags.message) = { select: true, set: true }; - - SubMessage sub = 1 [ - (gogoproto.embed) = true - ]; - SubMessageWithoutMarshalers other_sub = 2 [ - (gogoproto.embed) = true - ]; -} - -message MessageWithNullableEmbedded{ - option (thethings.flags.message) = { select: true, set: true }; - - SubMessage sub = 1 [ - (gogoproto.nullable) = false, - (gogoproto.embed) = true - ]; - SubMessageWithoutMarshalers other_sub = 2 [ - (gogoproto.nullable) = false, - (gogoproto.embed) = true - ]; -} diff --git a/test/gogo/api.pb.go b/test/gogo/api.pb.go deleted file mode 100644 index a415d3b..0000000 --- a/test/gogo/api.pb.go +++ /dev/null @@ -1,34 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: api.proto - -package test - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -func init() { proto.RegisterFile("api.proto", fileDescriptor_00212fb1f9d3bf1c) } - -var fileDescriptor_00212fb1f9d3bf1c = []byte{ - // 110 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4c, 0x2c, 0xc8, 0xd4, - 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x29, 0xc9, 0x48, 0x2d, 0xc9, 0xc8, 0xcc, 0x4b, 0x2f, - 0xd6, 0x4b, 0xcb, 0x49, 0x4c, 0x2f, 0xd6, 0x2b, 0x49, 0x2d, 0x2e, 0x71, 0xb2, 0x8c, 0x32, 0x4f, - 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x0f, 0xc9, 0x48, 0x0d, 0x01, 0x2b, - 0xf1, 0xcc, 0x4b, 0x29, 0x2d, 0x2e, 0x29, 0xca, 0x4c, 0x2d, 0xd6, 0x07, 0xeb, 0x4e, 0xd6, 0x4d, - 0x4f, 0xcd, 0xd3, 0x4d, 0xcf, 0xd7, 0x05, 0x6b, 0xd5, 0x07, 0x69, 0x4d, 0x62, 0x03, 0xcb, 0x18, - 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xb9, 0xa6, 0x81, 0xfe, 0x64, 0x00, 0x00, 0x00, -} diff --git a/test/gogo/enums.pb.go b/test/gogo/enums.pb.go deleted file mode 100644 index d171098..0000000 --- a/test/gogo/enums.pb.go +++ /dev/null @@ -1,473 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: enums.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - math "math" - strconv "strconv" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type RegularEnum int32 - -const ( - REGULAR_UNKNOWN RegularEnum = 0 - REGULAR_A RegularEnum = 1 - REGULAR_B RegularEnum = 2 -) - -var RegularEnum_name = map[int32]string{ - 0: "REGULAR_UNKNOWN", - 1: "REGULAR_A", - 2: "REGULAR_B", -} - -var RegularEnum_value = map[string]int32{ - "REGULAR_UNKNOWN": 0, - "REGULAR_A": 1, - "REGULAR_B": 2, -} - -func (RegularEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{0} -} - -type CustomEnum int32 - -const ( - CustomEnum_CUSTOM_UNKNOWN CustomEnum = 0 - CustomEnum_CUSTOM_V1_0 CustomEnum = 1 - CustomEnum_CUSTOM_V1_0_1 CustomEnum = 2 -) - -var CustomEnum_name = map[int32]string{ - 0: "CUSTOM_UNKNOWN", - 1: "CUSTOM_V1_0", - 2: "CUSTOM_V1_0_1", -} - -var CustomEnum_value = map[string]int32{ - "CUSTOM_UNKNOWN": 0, - "CUSTOM_V1_0": 1, - "CUSTOM_V1_0_1": 2, -} - -func (CustomEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{1} -} - -type MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum int32 - -const ( - AT_MOST_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 0 - AT_LEAST_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 1 - EXACTLY_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 2 -) - -var MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_name = map[int32]string{ - 0: "AT_MOST_ONCE", - 1: "AT_LEAST_ONCE", - 2: "EXACTLY_ONCE", -} - -var MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value = map[string]int32{ - "AT_MOST_ONCE": 0, - "AT_LEAST_ONCE": 1, - "EXACTLY_ONCE": 2, -} - -func (MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) EnumDescriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{3, 0, 0} -} - -type CustomEnumValue struct { - Value CustomEnum `protobuf:"varint,1,opt,name=value,proto3,enum=thethings.flags.test.CustomEnum" json:"value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *CustomEnumValue) Reset() { *m = CustomEnumValue{} } -func (m *CustomEnumValue) String() string { return proto.CompactTextString(m) } -func (*CustomEnumValue) ProtoMessage() {} -func (*CustomEnumValue) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{0} -} -func (m *CustomEnumValue) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_CustomEnumValue.Unmarshal(m, b) -} -func (m *CustomEnumValue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_CustomEnumValue.Marshal(b, m, deterministic) -} -func (m *CustomEnumValue) XXX_Merge(src proto.Message) { - xxx_messageInfo_CustomEnumValue.Merge(m, src) -} -func (m *CustomEnumValue) XXX_Size() int { - return xxx_messageInfo_CustomEnumValue.Size(m) -} -func (m *CustomEnumValue) XXX_DiscardUnknown() { - xxx_messageInfo_CustomEnumValue.DiscardUnknown(m) -} - -var xxx_messageInfo_CustomEnumValue proto.InternalMessageInfo - -func (m *CustomEnumValue) GetValue() CustomEnum { - if m != nil { - return m.Value - } - return CustomEnum_CUSTOM_UNKNOWN -} - -type MessageWithEnums struct { - Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.flags.test.RegularEnum" json:"regular,omitempty"` - Regulars []RegularEnum `protobuf:"varint,2,rep,packed,name=regulars,proto3,enum=thethings.flags.test.RegularEnum" json:"regulars,omitempty"` - Custom CustomEnum `protobuf:"varint,3,opt,name=custom,proto3,enum=thethings.flags.test.CustomEnum" json:"custom,omitempty"` - Customs []CustomEnum `protobuf:"varint,4,rep,packed,name=customs,proto3,enum=thethings.flags.test.CustomEnum" json:"customs,omitempty"` - WrappedCustom *CustomEnumValue `protobuf:"bytes,5,opt,name=wrapped_custom,json=wrappedCustom,proto3" json:"wrapped_custom,omitempty"` - WrappedCustoms []*CustomEnumValue `protobuf:"bytes,6,rep,name=wrapped_customs,json=wrappedCustoms,proto3" json:"wrapped_customs,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEnums) Reset() { *m = MessageWithEnums{} } -func (m *MessageWithEnums) String() string { return proto.CompactTextString(m) } -func (*MessageWithEnums) ProtoMessage() {} -func (*MessageWithEnums) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{1} -} -func (m *MessageWithEnums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEnums.Unmarshal(m, b) -} -func (m *MessageWithEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEnums.Marshal(b, m, deterministic) -} -func (m *MessageWithEnums) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEnums.Merge(m, src) -} -func (m *MessageWithEnums) XXX_Size() int { - return xxx_messageInfo_MessageWithEnums.Size(m) -} -func (m *MessageWithEnums) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEnums.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEnums proto.InternalMessageInfo - -func (m *MessageWithEnums) GetRegular() RegularEnum { - if m != nil { - return m.Regular - } - return REGULAR_UNKNOWN -} - -func (m *MessageWithEnums) GetRegulars() []RegularEnum { - if m != nil { - return m.Regulars - } - return nil -} - -func (m *MessageWithEnums) GetCustom() CustomEnum { - if m != nil { - return m.Custom - } - return CustomEnum_CUSTOM_UNKNOWN -} - -func (m *MessageWithEnums) GetCustoms() []CustomEnum { - if m != nil { - return m.Customs - } - return nil -} - -func (m *MessageWithEnums) GetWrappedCustom() *CustomEnumValue { - if m != nil { - return m.WrappedCustom - } - return nil -} - -func (m *MessageWithEnums) GetWrappedCustoms() []*CustomEnumValue { - if m != nil { - return m.WrappedCustoms - } - return nil -} - -type MessageWithOneofEnums struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofEnums_Regular - // *MessageWithOneofEnums_Custom - // *MessageWithOneofEnums_WrappedCustom - Value isMessageWithOneofEnums_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofEnums) Reset() { *m = MessageWithOneofEnums{} } -func (m *MessageWithOneofEnums) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofEnums) ProtoMessage() {} -func (*MessageWithOneofEnums) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{2} -} -func (m *MessageWithOneofEnums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofEnums.Unmarshal(m, b) -} -func (m *MessageWithOneofEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofEnums.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofEnums) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofEnums.Merge(m, src) -} -func (m *MessageWithOneofEnums) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofEnums.Size(m) -} -func (m *MessageWithOneofEnums) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofEnums.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofEnums proto.InternalMessageInfo - -type isMessageWithOneofEnums_Value interface { - isMessageWithOneofEnums_Value() -} - -type MessageWithOneofEnums_Regular struct { - Regular RegularEnum `protobuf:"varint,1,opt,name=regular,proto3,enum=thethings.flags.test.RegularEnum,oneof" json:"regular,omitempty"` -} -type MessageWithOneofEnums_Custom struct { - Custom CustomEnum `protobuf:"varint,2,opt,name=custom,proto3,enum=thethings.flags.test.CustomEnum,oneof" json:"custom,omitempty"` -} -type MessageWithOneofEnums_WrappedCustom struct { - WrappedCustom *CustomEnumValue `protobuf:"bytes,3,opt,name=wrapped_custom,json=wrappedCustom,proto3,oneof" json:"wrapped_custom,omitempty"` -} - -func (*MessageWithOneofEnums_Regular) isMessageWithOneofEnums_Value() {} -func (*MessageWithOneofEnums_Custom) isMessageWithOneofEnums_Value() {} -func (*MessageWithOneofEnums_WrappedCustom) isMessageWithOneofEnums_Value() {} - -func (m *MessageWithOneofEnums) GetValue() isMessageWithOneofEnums_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofEnums) GetRegular() RegularEnum { - if x, ok := m.GetValue().(*MessageWithOneofEnums_Regular); ok { - return x.Regular - } - return REGULAR_UNKNOWN -} - -func (m *MessageWithOneofEnums) GetCustom() CustomEnum { - if x, ok := m.GetValue().(*MessageWithOneofEnums_Custom); ok { - return x.Custom - } - return CustomEnum_CUSTOM_UNKNOWN -} - -func (m *MessageWithOneofEnums) GetWrappedCustom() *CustomEnumValue { - if x, ok := m.GetValue().(*MessageWithOneofEnums_WrappedCustom); ok { - return x.WrappedCustom - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofEnums) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofEnums_Regular)(nil), - (*MessageWithOneofEnums_Custom)(nil), - (*MessageWithOneofEnums_WrappedCustom)(nil), - } -} - -type MessageWithEmbeddedMessageDefinitionWithEnums struct { - TestMessageField *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum `protobuf:"bytes,1,opt,name=test_message_field,json=testMessageField,proto3" json:"test_message_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) Reset() { - *m = MessageWithEmbeddedMessageDefinitionWithEnums{} -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) String() string { - return proto.CompactTextString(m) -} -func (*MessageWithEmbeddedMessageDefinitionWithEnums) ProtoMessage() {} -func (*MessageWithEmbeddedMessageDefinitionWithEnums) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{3} -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums.Unmarshal(m, b) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums.Marshal(b, m, deterministic) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums.Merge(m, src) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) XXX_Size() int { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums.Size(m) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums proto.InternalMessageInfo - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) GetTestMessageField() *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum { - if m != nil { - return m.TestMessageField - } - return nil -} - -type MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum struct { - StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - TestEnumValue MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum `protobuf:"varint,2,opt,name=test_enum_value,json=testEnumValue,proto3,enum=thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum" json:"test_enum_value,omitempty"` - TestAnotherEnumValue MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum `protobuf:"varint,3,opt,name=test_another_enum_value,json=testAnotherEnumValue,proto3,enum=thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum" json:"test_another_enum_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) Reset() { - *m = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum{} -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) String() string { - return proto.CompactTextString(m) -} -func (*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) ProtoMessage() { -} -func (*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) Descriptor() ([]byte, []int) { - return fileDescriptor_888b6bd9597961ff, []int{3, 0} -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.Unmarshal(m, b) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.Marshal(b, m, deterministic) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.Merge(m, src) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) XXX_Size() int { - return xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.Size(m) -} -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum proto.InternalMessageInfo - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetStringValue() string { - if m != nil { - return m.StringValue - } - return "" -} - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetTestEnumValue() MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum { - if m != nil { - return m.TestEnumValue - } - return AT_MOST_ONCE -} - -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetTestAnotherEnumValue() MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum { - if m != nil { - return m.TestAnotherEnumValue - } - return AT_MOST_ONCE -} - -func init() { - proto.RegisterEnum("thethings.flags.test.RegularEnum", RegularEnum_name, RegularEnum_value) - proto.RegisterEnum("thethings.flags.test.CustomEnum", CustomEnum_name, CustomEnum_value) - proto.RegisterEnum("thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum", MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_name, MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value) - proto.RegisterType((*CustomEnumValue)(nil), "thethings.flags.test.CustomEnumValue") - proto.RegisterType((*MessageWithEnums)(nil), "thethings.flags.test.MessageWithEnums") - proto.RegisterType((*MessageWithOneofEnums)(nil), "thethings.flags.test.MessageWithOneofEnums") - proto.RegisterType((*MessageWithEmbeddedMessageDefinitionWithEnums)(nil), "thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums") - proto.RegisterType((*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum)(nil), "thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum") -} - -func init() { proto.RegisterFile("enums.proto", fileDescriptor_888b6bd9597961ff) } - -var fileDescriptor_888b6bd9597961ff = []byte{ - // 697 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0xcf, 0x6e, 0xd3, 0x4e, - 0x10, 0xf6, 0x26, 0x6d, 0x9a, 0x4e, 0x9a, 0xc4, 0xdd, 0x5f, 0x7f, 0x22, 0x8d, 0x44, 0x94, 0x46, - 0x42, 0xaa, 0x2a, 0xc5, 0xa1, 0x45, 0x02, 0x14, 0xd4, 0x83, 0x1b, 0x02, 0x05, 0xd2, 0x44, 0x72, - 0x9d, 0x96, 0x72, 0xb1, 0xdc, 0x66, 0xe3, 0x58, 0x4a, 0xd6, 0x95, 0xd7, 0x86, 0x57, 0xe0, 0xce, - 0x8d, 0x0b, 0x07, 0xb8, 0x50, 0x71, 0xe0, 0x01, 0x78, 0x9a, 0x9e, 0x10, 0x27, 0x54, 0x89, 0x3b, - 0xda, 0xb5, 0x13, 0xbb, 0x50, 0x29, 0x29, 0x07, 0xb8, 0x4d, 0x66, 0xbf, 0xf9, 0xe6, 0xcf, 0x37, - 0xe3, 0x40, 0x86, 0x50, 0x7f, 0xc4, 0x94, 0x53, 0xd7, 0xf1, 0x1c, 0xbc, 0xe2, 0x0d, 0x88, 0x37, - 0xb0, 0xa9, 0xc5, 0x94, 0xfe, 0xd0, 0xb4, 0x98, 0xe2, 0x11, 0xe6, 0x15, 0x97, 0x4d, 0x4a, 0x1d, - 0xcf, 0xf4, 0x6c, 0x87, 0x86, 0xc0, 0xe2, 0x4d, 0x9b, 0x7a, 0xc4, 0xa5, 0xe6, 0xb0, 0x66, 0x39, - 0x96, 0x23, 0x7c, 0xc2, 0x0a, 0x9e, 0x2b, 0x5d, 0xc8, 0x37, 0x7c, 0xe6, 0x39, 0xa3, 0x26, 0xf5, - 0x47, 0x07, 0xe6, 0xd0, 0x27, 0xf8, 0x2e, 0xcc, 0xbf, 0xe4, 0x46, 0x01, 0x95, 0xd1, 0x7a, 0x6e, - 0xab, 0xac, 0x5c, 0x95, 0x4a, 0x89, 0xa2, 0xb4, 0x00, 0x5e, 0x87, 0x8b, 0xb3, 0xd5, 0x54, 0x1a, - 0xc9, 0xa8, 0x80, 0x2a, 0x9f, 0x92, 0x20, 0xef, 0x11, 0xc6, 0x4c, 0x8b, 0x1c, 0xda, 0xde, 0x80, - 0xc3, 0x18, 0x7e, 0x00, 0x0b, 0x2e, 0xb1, 0xfc, 0xa1, 0xe9, 0x86, 0xd4, 0x6b, 0x57, 0x53, 0x6b, - 0x01, 0x48, 0x70, 0x8f, 0x23, 0xf0, 0x36, 0xa4, 0x43, 0x93, 0x15, 0x12, 0xe5, 0xe4, 0x6c, 0xd1, - 0x93, 0x10, 0x7c, 0x1f, 0x52, 0x27, 0xa2, 0xe2, 0x42, 0x72, 0xc6, 0xae, 0x42, 0x3c, 0xae, 0xc3, - 0x42, 0x60, 0xb1, 0xc2, 0x9c, 0xc8, 0x3b, 0x3d, 0x74, 0x1c, 0x80, 0x5b, 0x90, 0x7b, 0xe5, 0x9a, - 0xa7, 0xa7, 0xa4, 0x67, 0x84, 0xd9, 0xe7, 0xcb, 0x68, 0x3d, 0xb3, 0x75, 0x6b, 0x1a, 0x85, 0x50, - 0x42, 0xcb, 0x86, 0xc1, 0x81, 0x1f, 0xb7, 0x21, 0x7f, 0x99, 0x8d, 0x15, 0x52, 0xe5, 0xe4, 0xec, - 0x74, 0xb9, 0x4b, 0x74, 0xac, 0x9e, 0xbe, 0x38, 0x5b, 0x9d, 0xe3, 0x82, 0x55, 0x7e, 0x20, 0xf8, - 0x3f, 0x26, 0x57, 0x87, 0x12, 0xa7, 0x1f, 0x68, 0xb6, 0x7d, 0x7d, 0xcd, 0x76, 0xa5, 0x48, 0xb5, - 0xfa, 0x64, 0xec, 0x89, 0xd9, 0xc6, 0xbe, 0x2b, 0x4d, 0x06, 0xdf, 0xfe, 0x6d, 0x78, 0xc9, 0x6b, - 0x0c, 0x6f, 0x57, 0xfa, 0x65, 0x7c, 0x51, 0xbb, 0x3b, 0x0b, 0xe1, 0x86, 0x57, 0xbe, 0xcc, 0x43, - 0x35, 0xbe, 0xa6, 0xa3, 0x63, 0xd2, 0xeb, 0x91, 0x5e, 0xe8, 0x7a, 0x48, 0xfa, 0x36, 0xb5, 0xf9, - 0x31, 0x45, 0x3b, 0xfc, 0x06, 0x01, 0xe6, 0xe9, 0x8c, 0x51, 0x80, 0x31, 0xfa, 0x36, 0x19, 0xf6, - 0xc4, 0x6c, 0x32, 0x5b, 0xe4, 0xea, 0xca, 0xae, 0x95, 0x41, 0x99, 0x0a, 0xd1, 0x64, 0xce, 0x1a, - 0x3e, 0x3f, 0xe2, 0xe9, 0x8b, 0xdf, 0x92, 0xb0, 0x36, 0x35, 0x0e, 0xaf, 0xc1, 0x12, 0xf3, 0x5c, - 0x9b, 0x5a, 0x46, 0x74, 0xdf, 0x8b, 0x5a, 0x26, 0xf0, 0x05, 0xb7, 0xff, 0x16, 0x41, 0x5e, 0xb4, - 0xc7, 0xbf, 0x35, 0x21, 0x2c, 0x50, 0xce, 0xfd, 0x2b, 0xbd, 0x4d, 0x10, 0xa2, 0xd1, 0x2c, 0x4f, - 0x11, 0x7d, 0x98, 0x3e, 0x22, 0xb8, 0x21, 0x8a, 0x33, 0xa9, 0xe3, 0x0d, 0x88, 0x1b, 0x2f, 0x32, - 0xf9, 0xcf, 0x8a, 0x5c, 0xe1, 0x29, 0xd4, 0xa0, 0xa2, 0x49, 0xad, 0x95, 0x0e, 0x2c, 0xc5, 0x51, - 0x58, 0x86, 0x25, 0x55, 0x37, 0xf6, 0x3a, 0xfb, 0xba, 0xd1, 0x69, 0x37, 0x9a, 0xb2, 0x84, 0x97, - 0x21, 0xab, 0xea, 0x46, 0xab, 0xa9, 0x8e, 0x5d, 0x88, 0x83, 0x9a, 0xcf, 0xd5, 0x86, 0xde, 0x3a, - 0x0a, 0x3c, 0x89, 0x62, 0xfa, 0xf5, 0xfb, 0x92, 0xf4, 0xf9, 0x43, 0x49, 0x8a, 0xb6, 0x37, 0xb2, - 0x36, 0x9e, 0x42, 0x26, 0x76, 0x77, 0xf8, 0x3f, 0xc8, 0x6b, 0xcd, 0xc7, 0xdd, 0x96, 0xaa, 0x19, - 0xdd, 0xf6, 0xb3, 0x76, 0xe7, 0xb0, 0x2d, 0x4b, 0x38, 0x0b, 0x8b, 0x63, 0xa7, 0x2a, 0xa3, 0xf8, - 0xcf, 0x9d, 0x38, 0xff, 0xc6, 0x3b, 0x04, 0x10, 0x9d, 0x10, 0xc6, 0x90, 0x6b, 0x74, 0xf7, 0xf5, - 0xce, 0x5e, 0x8c, 0x2a, 0x0f, 0x99, 0xd0, 0x77, 0xb0, 0x69, 0xdc, 0x96, 0x11, 0x6f, 0x21, 0xe6, - 0x30, 0x36, 0xe5, 0x44, 0xf1, 0xe8, 0xe2, 0x6c, 0xb5, 0x0b, 0xfb, 0x96, 0xed, 0x0d, 0xfc, 0x63, - 0xe5, 0xc4, 0x19, 0xd5, 0xf4, 0x01, 0xd1, 0x85, 0x22, 0x4f, 0x68, 0xcf, 0xe7, 0xbb, 0x46, 0x58, - 0x4d, 0xfc, 0xf7, 0x9c, 0x54, 0x2d, 0x42, 0xab, 0x96, 0x53, 0x15, 0x4a, 0xd5, 0xf8, 0x18, 0x6b, - 0x5c, 0xd1, 0xd8, 0x25, 0x87, 0x87, 0x2f, 0x24, 0xde, 0x51, 0xbf, 0x9e, 0x97, 0xa4, 0xef, 0xe7, - 0x25, 0xf4, 0xe2, 0xde, 0x1f, 0xd2, 0x1f, 0xa7, 0xc4, 0xcb, 0x9d, 0x9f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x37, 0x02, 0xf1, 0xdf, 0x4b, 0x07, 0x00, 0x00, -} - -func (x CustomEnum) String() string { - s, ok := CustomEnum_name[int32(x)] - if ok { - return s - } - return strconv.Itoa(int(x)) -} diff --git a/test/gogo/enums_flags.pb.go b/test/gogo/enums_flags.pb.go deleted file mode 100644 index d044c3e..0000000 --- a/test/gogo/enums_flags.pb.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.9.1 -// source: enums.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - enum "github.com/TheThingsIndustries/protoc-gen-go-flags/test/enum" - pflag "github.com/spf13/pflag" -) - -// AddSelectFlagsForCustomEnumValue adds flags to select fields in CustomEnumValue. -func AddSelectFlagsForCustomEnumValue(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forCustomEnumValue message from select flags. -func PathsFromSelectFlagsForCustomEnumValue(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForCustomEnumValue adds flags to select fields in CustomEnumValue. -func AddSetFlagsForCustomEnumValue(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("value", prefix), flagsplugin.EnumValueDesc(CustomEnum_value, enum.CustomEnum_customvalue), flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the CustomEnumValue message from flags. -func (m *CustomEnumValue) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("value", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, CustomEnum_value, enum.CustomEnum_customvalue) - if err != nil { - return nil, err - } - m.Value = CustomEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("value", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithEnums adds flags to select fields in MessageWithEnums. -func AddSelectFlagsForMessageWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("regular", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("regular", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("regulars", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("regulars", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("custom", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("custom", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("customs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("customs", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("wrapped-custom", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("wrapped-custom", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForCustomEnumValue(flags, flagsplugin.Prefix("wrapped-custom", prefix), true) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("wrapped-customs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("wrapped-customs", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEnums message from select flags. -func PathsFromSelectFlagsForMessageWithEnums(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("regular", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("regular", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("regulars", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("regulars", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("custom", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("custom", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("customs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("customs", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("wrapped_custom", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("wrapped_custom", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForCustomEnumValue(flags, flagsplugin.Prefix("wrapped_custom", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("wrapped_customs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("wrapped_customs", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEnums adds flags to select fields in MessageWithEnums. -func AddSetFlagsForMessageWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("regular", prefix), flagsplugin.EnumValueDesc(RegularEnum_value), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("regulars", prefix), flagsplugin.EnumValueDesc(RegularEnum_value), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("custom", prefix), flagsplugin.EnumValueDesc(CustomEnum_value, enum.CustomEnum_customvalue), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("customs", prefix), flagsplugin.EnumValueDesc(CustomEnum_value, enum.CustomEnum_customvalue), flagsplugin.WithHidden(hidden))) - AddSetFlagsForCustomEnumValue(flags, flagsplugin.Prefix("wrapped-custom", prefix), true) - flagsplugin.AddAlias(flags, flagsplugin.Prefix("wrapped-custom.value", prefix), flagsplugin.Prefix("wrapped-custom", prefix), flagsplugin.WithHidden(hidden)) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("wrapped-customs", prefix), flagsplugin.EnumValueDesc(CustomEnum_value, enum.CustomEnum_customvalue), flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithEnums message from flags. -func (m *MessageWithEnums) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("regular", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, RegularEnum_value) - if err != nil { - return nil, err - } - m.Regular = RegularEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("regular", prefix)) - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("regulars", prefix)); err != nil { - return nil, err - } else if changed { - m.Regulars = make([]RegularEnum, len(val)) - for i, v := range val { - enumValue, err := flagsplugin.SetEnumString(v, RegularEnum_value) - if err != nil { - return nil, err - } - m.Regulars[i] = RegularEnum(enumValue) - } - paths = append(paths, flagsplugin.Prefix("regulars", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("custom", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, CustomEnum_value, enum.CustomEnum_customvalue) - if err != nil { - return nil, err - } - m.Custom = CustomEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("custom", prefix)) - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("customs", prefix)); err != nil { - return nil, err - } else if changed { - m.Customs = make([]CustomEnum, len(val)) - for i, v := range val { - enumValue, err := flagsplugin.SetEnumString(v, CustomEnum_value, enum.CustomEnum_customvalue) - if err != nil { - return nil, err - } - m.Customs[i] = CustomEnum(enumValue) - } - paths = append(paths, flagsplugin.Prefix("customs", prefix)) - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("wrapped_custom", prefix)); changed { - if m.WrappedCustom == nil { - m.WrappedCustom = &CustomEnumValue{} - } - if setPaths, err := m.WrappedCustom.SetFromFlags(flags, flagsplugin.Prefix("wrapped_custom", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("wrapped_customs", prefix)); err != nil { - return nil, err - } else if changed { - m.WrappedCustoms = make([]*CustomEnumValue, len(val)) - for i, value := range val { - enumValue, err := flagsplugin.SetEnumString(value, CustomEnum_value, enum.CustomEnum_customvalue) - if err != nil { - return nil, err - } - m.WrappedCustoms[i] = &CustomEnumValue{Value: CustomEnum(enumValue)} - } - paths = append(paths, flagsplugin.Prefix("wrapped_customs", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithOneofEnums adds flags to select fields in MessageWithOneofEnums. -func AddSelectFlagsForMessageWithOneofEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.regular", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.regular", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.custom", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.custom", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.wrapped-custom", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.wrapped-custom", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForCustomEnumValue(flags, flagsplugin.Prefix("value.wrapped-custom", prefix), true) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithOneofEnums message from select flags. -func PathsFromSelectFlagsForMessageWithOneofEnums(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.regular", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.regular", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.custom", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.custom", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.wrapped_custom", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.wrapped_custom", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForCustomEnumValue(flags, flagsplugin.Prefix("value.wrapped_custom", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithOneofEnums adds flags to select fields in MessageWithOneofEnums. -func AddSetFlagsForMessageWithOneofEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("value.regular", prefix), flagsplugin.EnumValueDesc(RegularEnum_value), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("value.custom", prefix), flagsplugin.EnumValueDesc(CustomEnum_value, enum.CustomEnum_customvalue), flagsplugin.WithHidden(hidden))) - AddSetFlagsForCustomEnumValue(flags, flagsplugin.Prefix("value.wrapped-custom", prefix), true) - flagsplugin.AddAlias(flags, flagsplugin.Prefix("value.wrapped-custom.value", prefix), flagsplugin.Prefix("value.wrapped-custom", prefix), flagsplugin.WithHidden(hidden)) -} - -// SetFromFlags sets the MessageWithOneofEnums message from flags. -func (m *MessageWithOneofEnums) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("value.regular", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofEnums_Regular{} - enumValue, err := flagsplugin.SetEnumString(val, RegularEnum_value) - if err != nil { - return nil, err - } - ov.Regular = RegularEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("value.regular", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("value.custom", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofEnums_Custom{} - enumValue, err := flagsplugin.SetEnumString(val, CustomEnum_value, enum.CustomEnum_customvalue) - if err != nil { - return nil, err - } - ov.Custom = CustomEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("value.custom", prefix)) - m.Value = ov - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("value.wrapped_custom", prefix)); changed { - ov := &MessageWithOneofEnums_WrappedCustom{} - if ov.WrappedCustom == nil { - ov.WrappedCustom = &CustomEnumValue{} - } - if setPaths, err := ov.WrappedCustom.SetFromFlags(flags, flagsplugin.Prefix("value.wrapped_custom", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - m.Value = ov - } - return paths, nil -} - -// AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum. -func AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-enum-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-enum-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-another-enum-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-another-enum-value", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum message from select flags. -func PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_enum_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_enum_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_another_enum_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_another_enum_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum. -func AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("test-enum-value", prefix), flagsplugin.EnumValueDesc(MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("test-another-enum-value", prefix), flagsplugin.EnumValueDesc(MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value), flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum message from flags. -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValue = val - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("test_enum_value", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value) - if err != nil { - return nil, err - } - m.TestEnumValue = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("test_enum_value", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("test_another_enum_value", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value) - if err != nil { - return nil, err - } - m.TestAnotherEnumValue = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("test_another_enum_value", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums. -func AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-message-field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-message-field", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test-message-field", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbeddedMessageDefinitionWithEnums message from select flags. -func PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_message_field", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums. -func AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test-message-field", prefix), hidden) -} - -// SetFromFlags sets the MessageWithEmbeddedMessageDefinitionWithEnums message from flags. -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("test_message_field", prefix)); changed { - if m.TestMessageField == nil { - m.TestMessageField = &MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum{} - } - if setPaths, err := m.TestMessageField.SetFromFlags(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} diff --git a/test/gogo/enums_test.go b/test/gogo/enums_test.go deleted file mode 100644 index 822c80c..0000000 --- a/test/gogo/enums_test.go +++ /dev/null @@ -1,153 +0,0 @@ -package test_test - -import ( - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/gogo" - pflag "github.com/spf13/pflag" -) - -var testMessagesWithEnums = []struct { - name string - arguments []string - expectedMessage MessageWithEnums - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithEnums{}, - expectedMask: nil, - }, - { - name: "one field set", - arguments: []string{"--regular", "1", ""}, - expectedMessage: MessageWithEnums{ - Regular: REGULAR_A, - }, - expectedMask: []string{"regular"}, - }, - { - name: "all fields set", - arguments: []string{ - "--regular", "1", - "--regulars", "1", - "--regulars", "REGULAR_B", - "--custom", "CUSTOM_V1_0", - "--customs", "0,1", - "--wrapped-custom", "1", - "--wrapped-customs", "1,2", - }, - expectedMessage: MessageWithEnums{ - Regular: REGULAR_A, - Regulars: []RegularEnum{REGULAR_A, REGULAR_B}, - Custom: CustomEnum_CUSTOM_V1_0, - Customs: []CustomEnum{CustomEnum_CUSTOM_UNKNOWN, CustomEnum_CUSTOM_V1_0}, - WrappedCustom: &CustomEnumValue{Value: CustomEnum_CUSTOM_V1_0}, - WrappedCustoms: []*CustomEnumValue{{Value: CustomEnum_CUSTOM_V1_0}, {Value: CustomEnum_CUSTOM_V1_0_1}}, - }, - expectedMask: []string{ - "regular", - "regulars", - "custom", - "customs", - "wrapped_custom.value", - "wrapped_customs", - }, - }, - { - name: "alias custom enum value set", - arguments: []string{ - "--custom", "1.0.0", - "--customs", "1.0.1,V1_0_1,1.0,unknown", - "--wrapped-custom", "UNKNOWN", - "--wrapped-customs", "unknown,1.0", - }, - expectedMessage: MessageWithEnums{ - Custom: CustomEnum_CUSTOM_V1_0, - Customs: []CustomEnum{CustomEnum_CUSTOM_V1_0_1, CustomEnum_CUSTOM_V1_0_1, CustomEnum_CUSTOM_V1_0, CustomEnum_CUSTOM_UNKNOWN}, - WrappedCustom: &CustomEnumValue{Value: CustomEnum_CUSTOM_UNKNOWN}, - WrappedCustoms: []*CustomEnumValue{{Value: CustomEnum_CUSTOM_UNKNOWN}, {Value: CustomEnum_CUSTOM_V1_0}}, - }, - expectedMask: []string{ - "custom", - "customs", - "wrapped_custom.value", - "wrapped_customs", - }, - }, -} - -var testMessagesWithOneofEnums = []struct { - name string - arguments []string - expectedMessage MessageWithOneofEnums - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithOneofEnums{}, - expectedMask: nil, - }, - { - name: "field set", - arguments: []string{ - "--value.regular", "1", - }, - expectedMessage: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_Regular{Regular: REGULAR_A}, - }, - expectedMask: []string{ - "value.regular", - }, - }, - { - name: "all fields set", - arguments: []string{ - "--value.wrapped-custom", "1", - }, - expectedMessage: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{Value: CustomEnum_CUSTOM_V1_0}}, - }, - expectedMask: []string{ - "value.wrapped_custom.value", - }, - }, - { - name: "multiple fields set, last one overwriting others", - arguments: []string{ - "--value.regular", "1", - "--value.custom", "1", - "--value.wrapped-custom", "1", - }, - expectedMessage: MessageWithOneofEnums{ - Value: &MessageWithOneofEnums_WrappedCustom{WrappedCustom: &CustomEnumValue{Value: CustomEnum_CUSTOM_V1_0}}, - }, - expectedMask: []string{ - "value.regular", - "value.custom", - "value.wrapped_custom.value", - }, - }, -} - -func TestSetFlagsMessageWithEnums(t *testing.T) { - for _, tt := range testMessagesWithEnums { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithEnums(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithOneofEnums(t *testing.T) { - for _, tt := range testMessagesWithOneofEnums { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithOneofEnums(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/gogo/gogo.pb.go b/test/gogo/gogo.pb.go deleted file mode 100644 index 9942c53..0000000 --- a/test/gogo/gogo.pb.go +++ /dev/null @@ -1,365 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: gogo.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - github_com_TheThingsIndustries_protoc_gen_go_flags_test_types "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" - math "math" - time "time" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf -var _ = time.Kitchen - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MessageWithGoGoOptions struct { - EUIWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` - EUIWithCustomNameAndType *github_com_TheThingsIndustries_protoc_gen_go_flags_test_types.EUI64 `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64" json:"eui_with_custom_name_and_type,omitempty"` - NonNullableEUIWithCustomNameAndType github_com_TheThingsIndustries_protoc_gen_go_flags_test_types.EUI64 `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64" json:"non_nullable_eui_with_custom_name_and_type"` - EUIsWithCustomNameAndType []github_com_TheThingsIndustries_protoc_gen_go_flags_test_types.EUI64 `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3,customtype=github.com/TheThingsIndustries/protoc-gen-go-flags/test/types.EUI64" json:"euis_with_custom_name_and_type,omitempty"` - Duration *time.Duration `protobuf:"bytes,5,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` - NonNullableDuration time.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3,stdduration" json:"non_nullable_duration"` - Timestamp *time.Time `protobuf:"bytes,7,opt,name=timestamp,proto3,stdtime" json:"timestamp,omitempty"` - NonNullableTimestamp time.Time `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3,stdtime" json:"non_nullable_timestamp"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithGoGoOptions) Reset() { *m = MessageWithGoGoOptions{} } -func (m *MessageWithGoGoOptions) String() string { return proto.CompactTextString(m) } -func (*MessageWithGoGoOptions) ProtoMessage() {} -func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{0} -} -func (m *MessageWithGoGoOptions) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithGoGoOptions.Unmarshal(m, b) -} -func (m *MessageWithGoGoOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithGoGoOptions.Marshal(b, m, deterministic) -} -func (m *MessageWithGoGoOptions) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithGoGoOptions.Merge(m, src) -} -func (m *MessageWithGoGoOptions) XXX_Size() int { - return xxx_messageInfo_MessageWithGoGoOptions.Size(m) -} -func (m *MessageWithGoGoOptions) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithGoGoOptions.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithGoGoOptions proto.InternalMessageInfo - -func (m *MessageWithGoGoOptions) GetEUIWithCustomName() []byte { - if m != nil { - return m.EUIWithCustomName - } - return nil -} - -func (m *MessageWithGoGoOptions) GetDuration() *time.Duration { - if m != nil { - return m.Duration - } - return nil -} - -func (m *MessageWithGoGoOptions) GetNonNullableDuration() time.Duration { - if m != nil { - return m.NonNullableDuration - } - return 0 -} - -func (m *MessageWithGoGoOptions) GetTimestamp() *time.Time { - if m != nil { - return m.Timestamp - } - return nil -} - -func (m *MessageWithGoGoOptions) GetNonNullableTimestamp() time.Time { - if m != nil { - return m.NonNullableTimestamp - } - return time.Time{} -} - -type SubMessage struct { - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubMessage) Reset() { *m = SubMessage{} } -func (m *SubMessage) String() string { return proto.CompactTextString(m) } -func (*SubMessage) ProtoMessage() {} -func (*SubMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{1} -} -func (m *SubMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubMessage.Unmarshal(m, b) -} -func (m *SubMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubMessage.Marshal(b, m, deterministic) -} -func (m *SubMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubMessage.Merge(m, src) -} -func (m *SubMessage) XXX_Size() int { - return xxx_messageInfo_SubMessage.Size(m) -} -func (m *SubMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SubMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SubMessage proto.InternalMessageInfo - -func (m *SubMessage) GetField() string { - if m != nil { - return m.Field - } - return "" -} - -type SubMessageWithoutMarshalers struct { - OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SubMessageWithoutMarshalers) Reset() { *m = SubMessageWithoutMarshalers{} } -func (m *SubMessageWithoutMarshalers) String() string { return proto.CompactTextString(m) } -func (*SubMessageWithoutMarshalers) ProtoMessage() {} -func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{2} -} -func (m *SubMessageWithoutMarshalers) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SubMessageWithoutMarshalers.Unmarshal(m, b) -} -func (m *SubMessageWithoutMarshalers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SubMessageWithoutMarshalers.Marshal(b, m, deterministic) -} -func (m *SubMessageWithoutMarshalers) XXX_Merge(src proto.Message) { - xxx_messageInfo_SubMessageWithoutMarshalers.Merge(m, src) -} -func (m *SubMessageWithoutMarshalers) XXX_Size() int { - return xxx_messageInfo_SubMessageWithoutMarshalers.Size(m) -} -func (m *SubMessageWithoutMarshalers) XXX_DiscardUnknown() { - xxx_messageInfo_SubMessageWithoutMarshalers.DiscardUnknown(m) -} - -var xxx_messageInfo_SubMessageWithoutMarshalers proto.InternalMessageInfo - -func (m *SubMessageWithoutMarshalers) GetOtherField() string { - if m != nil { - return m.OtherField - } - return "" -} - -type MessageWithNullable struct { - Sub SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub"` - Subs []SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs"` - OtherSub SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub"` - OtherSubs []SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithNullable) Reset() { *m = MessageWithNullable{} } -func (m *MessageWithNullable) String() string { return proto.CompactTextString(m) } -func (*MessageWithNullable) ProtoMessage() {} -func (*MessageWithNullable) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{3} -} -func (m *MessageWithNullable) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithNullable.Unmarshal(m, b) -} -func (m *MessageWithNullable) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithNullable.Marshal(b, m, deterministic) -} -func (m *MessageWithNullable) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithNullable.Merge(m, src) -} -func (m *MessageWithNullable) XXX_Size() int { - return xxx_messageInfo_MessageWithNullable.Size(m) -} -func (m *MessageWithNullable) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithNullable.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithNullable proto.InternalMessageInfo - -func (m *MessageWithNullable) GetSub() SubMessage { - if m != nil { - return m.Sub - } - return SubMessage{} -} - -func (m *MessageWithNullable) GetSubs() []SubMessage { - if m != nil { - return m.Subs - } - return nil -} - -func (m *MessageWithNullable) GetOtherSub() SubMessageWithoutMarshalers { - if m != nil { - return m.OtherSub - } - return SubMessageWithoutMarshalers{} -} - -func (m *MessageWithNullable) GetOtherSubs() []SubMessageWithoutMarshalers { - if m != nil { - return m.OtherSubs - } - return nil -} - -type MessageWithEmbedded struct { - *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub,omitempty"` - *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithEmbedded) Reset() { *m = MessageWithEmbedded{} } -func (m *MessageWithEmbedded) String() string { return proto.CompactTextString(m) } -func (*MessageWithEmbedded) ProtoMessage() {} -func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{4} -} -func (m *MessageWithEmbedded) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithEmbedded.Unmarshal(m, b) -} -func (m *MessageWithEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithEmbedded.Marshal(b, m, deterministic) -} -func (m *MessageWithEmbedded) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithEmbedded.Merge(m, src) -} -func (m *MessageWithEmbedded) XXX_Size() int { - return xxx_messageInfo_MessageWithEmbedded.Size(m) -} -func (m *MessageWithEmbedded) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithEmbedded.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithEmbedded proto.InternalMessageInfo - -type MessageWithNullableEmbedded struct { - SubMessage `protobuf:"bytes,1,opt,name=sub,proto3,embedded=sub" json:"sub"` - SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3,embedded=other_sub" json:"other_sub"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithNullableEmbedded) Reset() { *m = MessageWithNullableEmbedded{} } -func (m *MessageWithNullableEmbedded) String() string { return proto.CompactTextString(m) } -func (*MessageWithNullableEmbedded) ProtoMessage() {} -func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { - return fileDescriptor_592445b5231bc2b9, []int{5} -} -func (m *MessageWithNullableEmbedded) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithNullableEmbedded.Unmarshal(m, b) -} -func (m *MessageWithNullableEmbedded) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithNullableEmbedded.Marshal(b, m, deterministic) -} -func (m *MessageWithNullableEmbedded) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithNullableEmbedded.Merge(m, src) -} -func (m *MessageWithNullableEmbedded) XXX_Size() int { - return xxx_messageInfo_MessageWithNullableEmbedded.Size(m) -} -func (m *MessageWithNullableEmbedded) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithNullableEmbedded.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithNullableEmbedded proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MessageWithGoGoOptions)(nil), "thethings.flags.test.MessageWithGoGoOptions") - proto.RegisterType((*SubMessage)(nil), "thethings.flags.test.SubMessage") - proto.RegisterType((*SubMessageWithoutMarshalers)(nil), "thethings.flags.test.SubMessageWithoutMarshalers") - proto.RegisterType((*MessageWithNullable)(nil), "thethings.flags.test.MessageWithNullable") - proto.RegisterType((*MessageWithEmbedded)(nil), "thethings.flags.test.MessageWithEmbedded") - proto.RegisterType((*MessageWithNullableEmbedded)(nil), "thethings.flags.test.MessageWithNullableEmbedded") -} - -func init() { proto.RegisterFile("gogo.proto", fileDescriptor_592445b5231bc2b9) } - -var fileDescriptor_592445b5231bc2b9 = []byte{ - // 755 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x95, 0xc1, 0x4f, 0xd3, 0x50, - 0x1c, 0xc7, 0x6d, 0x37, 0x70, 0x7b, 0xe3, 0x20, 0x65, 0x90, 0x6d, 0x04, 0xba, 0xc0, 0x85, 0x18, - 0xe9, 0x22, 0x1a, 0x45, 0x34, 0x26, 0x0e, 0x07, 0x2e, 0x86, 0x49, 0xc6, 0x10, 0xc3, 0xa5, 0x79, - 0x5d, 0x1f, 0x6d, 0x93, 0xee, 0xbd, 0x65, 0xef, 0xbd, 0x20, 0x57, 0xef, 0x26, 0x7a, 0x33, 0x9e, - 0xf5, 0xc2, 0xc5, 0x3f, 0xc1, 0x83, 0x1e, 0x3c, 0xea, 0xd5, 0xc3, 0x4c, 0xb8, 0x7a, 0xe3, 0x2f, - 0x30, 0x7d, 0xdd, 0xda, 0x8e, 0x0d, 0x08, 0xb0, 0x83, 0xc7, 0xf6, 0xf7, 0xfb, 0x7d, 0xfa, 0x7d, - 0x9f, 0x76, 0xbf, 0x01, 0x60, 0x11, 0x8b, 0x68, 0xcd, 0x16, 0x61, 0x44, 0x49, 0x33, 0x1b, 0x31, - 0xdb, 0xc1, 0x16, 0xd5, 0xf6, 0x5c, 0x68, 0x51, 0x8d, 0x21, 0xca, 0x72, 0xe3, 0x10, 0x63, 0xc2, - 0x20, 0x73, 0x08, 0xa6, 0x7e, 0x63, 0x6e, 0xc6, 0xc1, 0x0c, 0xb5, 0x30, 0x74, 0x0b, 0xde, 0xb4, - 0xb8, 0x57, 0x08, 0x39, 0xb9, 0x59, 0x8b, 0x10, 0xcb, 0x45, 0x05, 0x71, 0x65, 0xf0, 0xbd, 0x82, - 0xc9, 0x5b, 0x62, 0xbe, 0x53, 0x57, 0x4f, 0xd6, 0x99, 0xd3, 0x40, 0x94, 0xc1, 0x46, 0xd3, 0x6f, - 0x98, 0xfb, 0x9c, 0x02, 0x53, 0x1b, 0x88, 0x52, 0x68, 0xa1, 0x1d, 0x87, 0xd9, 0xeb, 0x64, 0x9d, - 0xbc, 0x68, 0x8a, 0x00, 0xca, 0x1a, 0x48, 0x23, 0xee, 0xe8, 0xfb, 0x0e, 0xb3, 0xf5, 0x3a, 0xa7, - 0x8c, 0x34, 0x74, 0x0c, 0x1b, 0x28, 0x23, 0xe5, 0xa5, 0x85, 0xb1, 0xe2, 0xe4, 0x51, 0x5b, 0x1d, - 0x2f, 0x6d, 0x97, 0xbd, 0xa9, 0x55, 0x51, 0xad, 0xc0, 0x06, 0xaa, 0x8e, 0x23, 0xee, 0xf4, 0xde, - 0x52, 0xbe, 0xcb, 0x60, 0x66, 0x10, 0x48, 0x87, 0xd8, 0xd4, 0xd9, 0x41, 0x13, 0x65, 0x64, 0x41, - 0x7c, 0x23, 0x1f, 0x1f, 0x66, 0x3f, 0x4a, 0xb9, 0xe7, 0x96, 0xc3, 0x6c, 0x6e, 0x68, 0x75, 0xd2, - 0x28, 0xd4, 0x6c, 0x54, 0x13, 0x9a, 0xca, 0xd8, 0xe4, 0x94, 0xb5, 0x1c, 0x44, 0xfd, 0xb3, 0xd4, - 0x17, 0x2d, 0x84, 0x17, 0x2d, 0xb2, 0x28, 0xf4, 0x15, 0x3c, 0x7d, 0x05, 0x8f, 0x45, 0xb5, 0x0a, - 0xda, 0x5f, 0x2e, 0x1e, 0x30, 0x44, 0xd7, 0x5c, 0x68, 0xcd, 0x5d, 0x11, 0xb6, 0x8e, 0x58, 0xe9, - 0x35, 0xac, 0x33, 0x01, 0xfc, 0xdd, 0x56, 0x57, 0xaf, 0x86, 0x2b, 0x6d, 0x97, 0xef, 0xdd, 0x3d, - 0x6a, 0xab, 0x99, 0x3e, 0x71, 0x4f, 0xb0, 0x59, 0x3b, 0x68, 0xa2, 0x6a, 0xa6, 0xcf, 0x5f, 0xa7, - 0xa2, 0xfc, 0x95, 0xc1, 0x4d, 0x4c, 0xb0, 0x8e, 0xb9, 0xeb, 0x42, 0xc3, 0x45, 0xfa, 0xd9, 0x4e, - 0x63, 0xc2, 0xe9, 0xfb, 0xff, 0xdd, 0xe9, 0x8f, 0xb6, 0x7a, 0x6d, 0x78, 0x5e, 0xe7, 0x2b, 0x04, - 0x57, 0x3a, 0x7e, 0x4e, 0x55, 0x3c, 0x8f, 0x23, 0x4d, 0xa7, 0xd9, 0xfe, 0x25, 0x83, 0x59, 0xc4, - 0x1d, 0x7a, 0x86, 0xe1, 0x78, 0x3e, 0xb6, 0x30, 0x56, 0x7c, 0xeb, 0x19, 0xfe, 0x24, 0xe5, 0x36, - 0x87, 0x64, 0x78, 0xcb, 0x75, 0xea, 0x48, 0x68, 0xde, 0x1c, 0xa2, 0x66, 0x41, 0x1d, 0x9e, 0xe7, - 0x6c, 0x69, 0xbb, 0x4c, 0x07, 0xdb, 0xcd, 0x7a, 0xd6, 0x06, 0x3b, 0x7d, 0x08, 0x12, 0xdd, 0xf5, - 0x94, 0x19, 0xc9, 0x4b, 0x0b, 0xa9, 0xa5, 0xac, 0xe6, 0xef, 0x27, 0xad, 0xbb, 0x9f, 0xb4, 0xa7, - 0x9d, 0x86, 0x62, 0xfc, 0xc3, 0x1f, 0x55, 0xaa, 0x06, 0x03, 0xca, 0x0e, 0x98, 0xec, 0xf9, 0xfa, - 0x03, 0xd2, 0xe8, 0x79, 0xa4, 0x84, 0xf7, 0x8d, 0x09, 0xda, 0x44, 0xe4, 0xcd, 0x77, 0xcb, 0xca, - 0x63, 0x90, 0x0c, 0x96, 0x62, 0xe6, 0xba, 0x80, 0xe5, 0xfa, 0x60, 0xb5, 0x6e, 0x47, 0x31, 0xfe, - 0xce, 0x23, 0x85, 0x23, 0xca, 0x2e, 0x98, 0xea, 0x09, 0x16, 0xc2, 0x12, 0xe7, 0xc2, 0x44, 0x34, - 0x01, 0x4c, 0x47, 0xa2, 0x05, 0xf5, 0x95, 0xc4, 0xf1, 0x61, 0x36, 0x9e, 0x90, 0x6e, 0x48, 0x73, - 0xb7, 0x00, 0xd8, 0xe2, 0x46, 0x67, 0x53, 0x2b, 0x69, 0x30, 0xb2, 0xe7, 0x20, 0xd7, 0x14, 0xbb, - 0x38, 0x59, 0xf5, 0x2f, 0x22, 0xdd, 0xcf, 0xc0, 0x74, 0xd8, 0xed, 0xbd, 0x0c, 0xc2, 0xd9, 0x06, - 0x6c, 0x51, 0x1b, 0xba, 0xa8, 0x45, 0x15, 0x15, 0xa4, 0x08, 0xb3, 0x51, 0x4b, 0x8f, 0x42, 0x80, - 0xb8, 0xb5, 0x76, 0x82, 0xf4, 0x4d, 0x06, 0x13, 0x11, 0x4e, 0x37, 0xa2, 0xb2, 0x0c, 0x62, 0x94, - 0x1b, 0x62, 0x34, 0xb5, 0x94, 0xd7, 0x06, 0xfd, 0x9d, 0x69, 0x61, 0x84, 0x62, 0xdc, 0x3b, 0x68, - 0xd5, 0x1b, 0x51, 0x56, 0x40, 0x9c, 0x72, 0x83, 0x66, 0xe4, 0x7c, 0xec, 0x02, 0xa3, 0x62, 0x46, - 0xa9, 0x81, 0xa4, 0x1f, 0xdc, 0x7b, 0x76, 0x4c, 0x3c, 0xfb, 0xf6, 0x79, 0x80, 0xbe, 0xe3, 0x77, - 0x88, 0x09, 0x41, 0xda, 0xe2, 0x86, 0xf2, 0x12, 0x80, 0x80, 0x4a, 0xc5, 0xcf, 0xfa, 0x0a, 0xd8, - 0x64, 0x17, 0x4b, 0x23, 0x16, 0xbf, 0x48, 0x3d, 0x16, 0x4b, 0x0d, 0x03, 0x99, 0x26, 0x32, 0x2f, - 0x6c, 0xf1, 0x67, 0x5b, 0x95, 0x7c, 0x8b, 0x3d, 0x26, 0xe4, 0x4b, 0x9b, 0x10, 0xc0, 0xc0, 0x44, - 0x24, 0xf1, 0x57, 0x09, 0x4c, 0x0f, 0x78, 0xef, 0x41, 0xf2, 0x47, 0x17, 0x4b, 0x2e, 0x3e, 0xf4, - 0x30, 0xfd, 0xab, 0xa1, 0xa4, 0x0f, 0xa1, 0x03, 0x4e, 0x50, 0x7c, 0xb0, 0x7b, 0xff, 0x92, 0xcb, - 0xce, 0x18, 0x15, 0x95, 0x3b, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x53, 0xff, 0x32, 0xb2, - 0x09, 0x00, 0x00, -} diff --git a/test/gogo/gogo_flags.pb.go b/test/gogo/gogo_flags.pb.go deleted file mode 100644 index 4ad2011..0000000 --- a/test/gogo/gogo_flags.pb.go +++ /dev/null @@ -1,393 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.9.1 -// source: gogo.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - types "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types" - pflag "github.com/spf13/pflag" -) - -// AddSelectFlagsForMessageWithGoGoOptions adds flags to select fields in MessageWithGoGoOptions. -func AddSelectFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("eui-with-custom-name", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("eui-with-custom-name", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("duration", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("duration", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-duration", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-duration", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("timestamp", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("timestamp", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-timestamp", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-timestamp", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithGoGoOptions message from select flags. -func PathsFromSelectFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("eui_with_custom_name", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("duration", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("duration", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_duration", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_duration", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("timestamp", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("timestamp", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_timestamp", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_timestamp", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithGoGoOptions adds flags to select fields in MessageWithGoGoOptions. -func AddSetFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("eui-with-custom-name", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesFlag(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesFlag(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesSliceFlag(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("duration", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("non-nullable-duration", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("timestamp", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("non-nullable-timestamp", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithGoGoOptions message from flags. -func (m *MessageWithGoGoOptions) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("eui_with_custom_name", prefix)); err != nil { - return nil, err - } else if changed { - m.EUIWithCustomName = val - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name", prefix)) - } - if val, changed, err := types.GetEUI64(flags, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.EUIWithCustomNameAndType = &val - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)) - } - if val, changed, err := types.GetEUI64(flags, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableEUIWithCustomNameAndType = val - paths = append(paths, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)) - } - if val, changed, err := types.GetEUI64Slice(flags, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.EUIsWithCustomNameAndType = val - paths = append(paths, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)) - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("duration", prefix)); err != nil { - return nil, err - } else if changed { - m.Duration = &val - paths = append(paths, flagsplugin.Prefix("duration", prefix)) - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("non_nullable_duration", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableDuration = val - paths = append(paths, flagsplugin.Prefix("non_nullable_duration", prefix)) - } - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("timestamp", prefix)); err != nil { - return nil, err - } else if changed { - m.Timestamp = &val - paths = append(paths, flagsplugin.Prefix("timestamp", prefix)) - } - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("non_nullable_timestamp", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableTimestamp = val - paths = append(paths, flagsplugin.Prefix("non_nullable_timestamp", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForSubMessage adds flags to select fields in SubMessage. -func AddSelectFlagsForSubMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("field", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forSubMessage message from select flags. -func PathsFromSelectFlagsForSubMessage(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("field", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSubMessage adds flags to select fields in SubMessage. -func AddSetFlagsForSubMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("field", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SubMessage message from flags. -func (m *SubMessage) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("field", prefix)); err != nil { - return nil, err - } else if changed { - m.Field = val - paths = append(paths, flagsplugin.Prefix("field", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForSubMessageWithoutMarshalers adds flags to select fields in SubMessageWithoutMarshalers. -func AddSelectFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-field", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forSubMessageWithoutMarshalers message from select flags. -func PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_field", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSubMessageWithoutMarshalers adds flags to select fields in SubMessageWithoutMarshalers. -func AddSetFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("other-field", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SubMessageWithoutMarshalers message from flags. -func (m *SubMessageWithoutMarshalers) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("other_field", prefix)); err != nil { - return nil, err - } else if changed { - m.OtherField = val - paths = append(paths, flagsplugin.Prefix("other_field", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithNullable adds flags to select fields in MessageWithNullable. -func AddSelectFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("subs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("subs", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-subs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-subs", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithNullable message from select flags. -func PathsFromSelectFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("subs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("subs", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_subs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_subs", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithNullable adds flags to select fields in MessageWithNullable. -func AddSetFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - // FIXME: Skipping Subs because repeated messages are currently not supported. - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) - // FIXME: Skipping OtherSubs because repeated messages are currently not supported. -} - -// SetFromFlags sets the MessageWithNullable message from flags. -func (m *MessageWithNullable) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if setPaths, err := m.Sub.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - // FIXME: Skipping Subs because it does not seem to implement AddSetFlags. - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if setPaths, err := m.OtherSub.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - // FIXME: Skipping OtherSubs because it does not seem to implement AddSetFlags. - return paths, nil -} - -// AddSelectFlagsForMessageWithEmbedded adds flags to select fields in MessageWithEmbedded. -func AddSelectFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbedded message from select flags. -func PathsFromSelectFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbedded adds flags to select fields in MessageWithEmbedded. -func AddSetFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SetFromFlags sets the MessageWithEmbedded message from flags. -func (m *MessageWithEmbedded) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if m.SubMessage == nil { - m.SubMessage = &SubMessage{} - } - if setPaths, err := m.SubMessage.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if m.SubMessageWithoutMarshalers == nil { - m.SubMessageWithoutMarshalers = &SubMessageWithoutMarshalers{} - } - if setPaths, err := m.SubMessageWithoutMarshalers.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} - -// AddSelectFlagsForMessageWithNullableEmbedded adds flags to select fields in MessageWithNullableEmbedded. -func AddSelectFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithNullableEmbedded message from select flags. -func PathsFromSelectFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithNullableEmbedded adds flags to select fields in MessageWithNullableEmbedded. -func AddSetFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SetFromFlags sets the MessageWithNullableEmbedded message from flags. -func (m *MessageWithNullableEmbedded) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if setPaths, err := m.SubMessage.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if setPaths, err := m.SubMessageWithoutMarshalers.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} diff --git a/test/gogo/gogo_test.go b/test/gogo/gogo_test.go deleted file mode 100644 index 692d83d..0000000 --- a/test/gogo/gogo_test.go +++ /dev/null @@ -1,93 +0,0 @@ -package test_test - -import ( - "encoding/hex" - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/gogo" - types "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types" - pflag "github.com/spf13/pflag" -) - -var testMessagesWithGoGoOptions = []struct { - name string - arguments []string - expectedMessage MessageWithGoGoOptions - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithGoGoOptions{ - NonNullableEUIWithCustomNameAndType: types.EUI64{}, - }, - expectedMask: nil, - }, - { - name: "full", - arguments: []string{ - "--eui-with-custom-name", "AQIDBAUGBwg=", - "--eui-with-custom-name-and-type", "0102030405060708", - "--non-nullable-eui-with-custom-name-and-type", "0102030405060708", - "--euis-with-custom-name-and-type", - "0102030405060708,0102030405060707,0102030405060709", - }, - expectedMessage: MessageWithGoGoOptions{ - EUIWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EUIWithCustomNameAndType: unmarshalEUI64("0102030405060708"), - NonNullableEUIWithCustomNameAndType: *unmarshalEUI64("0102030405060708"), - EUIsWithCustomNameAndType: []types.EUI64{ - *unmarshalEUI64("0102030405060708"), - *unmarshalEUI64("0102030405060707"), - *unmarshalEUI64("0102030405060709"), - }, - }, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - }, - }, -} - -var testMessagesWithNullable = []struct { - name string - arguments []string - expectedMessage MessageWithNullable - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithNullable{}, - expectedMask: nil, - }, -} - -func unmarshalEUI64(s string) *types.EUI64 { - var eui64 types.EUI64 - b, _ := hex.DecodeString(s) - eui64.Unmarshal(b) - return &eui64 -} - -func TestSetFlagsMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithGoGoOptions(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithNullable(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/gogo/message.pb.go b/test/gogo/message.pb.go deleted file mode 100644 index 20bacdb..0000000 --- a/test/gogo/message.pb.go +++ /dev/null @@ -1,330 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: message.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type SemanticalMessage struct { - Empty *SemanticalMessage_Empty `protobuf:"bytes,1,opt,name=empty,proto3" json:"empty,omitempty"` - EmptyOverruled *SemanticalMessage_Empty `protobuf:"bytes,2,opt,name=empty_overruled,json=emptyOverruled,proto3" json:"empty_overruled,omitempty"` - NonEmpty *SemanticalMessage_NonEmpty `protobuf:"bytes,3,opt,name=non_empty,json=nonEmpty,proto3" json:"non_empty,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalMessage) Reset() { *m = SemanticalMessage{} } -func (m *SemanticalMessage) String() string { return proto.CompactTextString(m) } -func (*SemanticalMessage) ProtoMessage() {} -func (*SemanticalMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0} -} -func (m *SemanticalMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalMessage.Unmarshal(m, b) -} -func (m *SemanticalMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalMessage.Marshal(b, m, deterministic) -} -func (m *SemanticalMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalMessage.Merge(m, src) -} -func (m *SemanticalMessage) XXX_Size() int { - return xxx_messageInfo_SemanticalMessage.Size(m) -} -func (m *SemanticalMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalMessage proto.InternalMessageInfo - -func (m *SemanticalMessage) GetEmpty() *SemanticalMessage_Empty { - if m != nil { - return m.Empty - } - return nil -} - -func (m *SemanticalMessage) GetEmptyOverruled() *SemanticalMessage_Empty { - if m != nil { - return m.EmptyOverruled - } - return nil -} - -func (m *SemanticalMessage) GetNonEmpty() *SemanticalMessage_NonEmpty { - if m != nil { - return m.NonEmpty - } - return nil -} - -type SemanticalMessage_Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalMessage_Empty) Reset() { *m = SemanticalMessage_Empty{} } -func (m *SemanticalMessage_Empty) String() string { return proto.CompactTextString(m) } -func (*SemanticalMessage_Empty) ProtoMessage() {} -func (*SemanticalMessage_Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0, 0} -} -func (m *SemanticalMessage_Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalMessage_Empty.Unmarshal(m, b) -} -func (m *SemanticalMessage_Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalMessage_Empty.Marshal(b, m, deterministic) -} -func (m *SemanticalMessage_Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalMessage_Empty.Merge(m, src) -} -func (m *SemanticalMessage_Empty) XXX_Size() int { - return xxx_messageInfo_SemanticalMessage_Empty.Size(m) -} -func (m *SemanticalMessage_Empty) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalMessage_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalMessage_Empty proto.InternalMessageInfo - -type SemanticalMessage_NonEmpty struct { - BoolValue bool `protobuf:"varint,1,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalMessage_NonEmpty) Reset() { *m = SemanticalMessage_NonEmpty{} } -func (m *SemanticalMessage_NonEmpty) String() string { return proto.CompactTextString(m) } -func (*SemanticalMessage_NonEmpty) ProtoMessage() {} -func (*SemanticalMessage_NonEmpty) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{0, 1} -} -func (m *SemanticalMessage_NonEmpty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalMessage_NonEmpty.Unmarshal(m, b) -} -func (m *SemanticalMessage_NonEmpty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalMessage_NonEmpty.Marshal(b, m, deterministic) -} -func (m *SemanticalMessage_NonEmpty) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalMessage_NonEmpty.Merge(m, src) -} -func (m *SemanticalMessage_NonEmpty) XXX_Size() int { - return xxx_messageInfo_SemanticalMessage_NonEmpty.Size(m) -} -func (m *SemanticalMessage_NonEmpty) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalMessage_NonEmpty.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalMessage_NonEmpty proto.InternalMessageInfo - -func (m *SemanticalMessage_NonEmpty) GetBoolValue() bool { - if m != nil { - return m.BoolValue - } - return false -} - -type SemanticalOneOfMessage struct { - // Types that are valid to be assigned to Option: - // - // *SemanticalOneOfMessage_Semantical - // *SemanticalOneOfMessage_Alternative - Option isSemanticalOneOfMessage_Option `protobuf_oneof:"option"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalOneOfMessage) Reset() { *m = SemanticalOneOfMessage{} } -func (m *SemanticalOneOfMessage) String() string { return proto.CompactTextString(m) } -func (*SemanticalOneOfMessage) ProtoMessage() {} -func (*SemanticalOneOfMessage) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1} -} -func (m *SemanticalOneOfMessage) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalOneOfMessage.Unmarshal(m, b) -} -func (m *SemanticalOneOfMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalOneOfMessage.Marshal(b, m, deterministic) -} -func (m *SemanticalOneOfMessage) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalOneOfMessage.Merge(m, src) -} -func (m *SemanticalOneOfMessage) XXX_Size() int { - return xxx_messageInfo_SemanticalOneOfMessage.Size(m) -} -func (m *SemanticalOneOfMessage) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalOneOfMessage.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalOneOfMessage proto.InternalMessageInfo - -type isSemanticalOneOfMessage_Option interface { - isSemanticalOneOfMessage_Option() -} - -type SemanticalOneOfMessage_Semantical struct { - Semantical *SemanticalOneOfMessage_Empty `protobuf:"bytes,1,opt,name=semantical,proto3,oneof" json:"semantical,omitempty"` -} -type SemanticalOneOfMessage_Alternative struct { - Alternative *SemanticalOneOfMessage_NonEmpty `protobuf:"bytes,2,opt,name=alternative,proto3,oneof" json:"alternative,omitempty"` -} - -func (*SemanticalOneOfMessage_Semantical) isSemanticalOneOfMessage_Option() {} -func (*SemanticalOneOfMessage_Alternative) isSemanticalOneOfMessage_Option() {} - -func (m *SemanticalOneOfMessage) GetOption() isSemanticalOneOfMessage_Option { - if m != nil { - return m.Option - } - return nil -} - -func (m *SemanticalOneOfMessage) GetSemantical() *SemanticalOneOfMessage_Empty { - if x, ok := m.GetOption().(*SemanticalOneOfMessage_Semantical); ok { - return x.Semantical - } - return nil -} - -func (m *SemanticalOneOfMessage) GetAlternative() *SemanticalOneOfMessage_NonEmpty { - if x, ok := m.GetOption().(*SemanticalOneOfMessage_Alternative); ok { - return x.Alternative - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*SemanticalOneOfMessage) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*SemanticalOneOfMessage_Semantical)(nil), - (*SemanticalOneOfMessage_Alternative)(nil), - } -} - -type SemanticalOneOfMessage_Empty struct { - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalOneOfMessage_Empty) Reset() { *m = SemanticalOneOfMessage_Empty{} } -func (m *SemanticalOneOfMessage_Empty) String() string { return proto.CompactTextString(m) } -func (*SemanticalOneOfMessage_Empty) ProtoMessage() {} -func (*SemanticalOneOfMessage_Empty) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1, 0} -} -func (m *SemanticalOneOfMessage_Empty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalOneOfMessage_Empty.Unmarshal(m, b) -} -func (m *SemanticalOneOfMessage_Empty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalOneOfMessage_Empty.Marshal(b, m, deterministic) -} -func (m *SemanticalOneOfMessage_Empty) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalOneOfMessage_Empty.Merge(m, src) -} -func (m *SemanticalOneOfMessage_Empty) XXX_Size() int { - return xxx_messageInfo_SemanticalOneOfMessage_Empty.Size(m) -} -func (m *SemanticalOneOfMessage_Empty) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalOneOfMessage_Empty.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalOneOfMessage_Empty proto.InternalMessageInfo - -type SemanticalOneOfMessage_NonEmpty struct { - BoolValue bool `protobuf:"varint,1,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *SemanticalOneOfMessage_NonEmpty) Reset() { *m = SemanticalOneOfMessage_NonEmpty{} } -func (m *SemanticalOneOfMessage_NonEmpty) String() string { return proto.CompactTextString(m) } -func (*SemanticalOneOfMessage_NonEmpty) ProtoMessage() {} -func (*SemanticalOneOfMessage_NonEmpty) Descriptor() ([]byte, []int) { - return fileDescriptor_33c57e4bae7b9afd, []int{1, 1} -} -func (m *SemanticalOneOfMessage_NonEmpty) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_SemanticalOneOfMessage_NonEmpty.Unmarshal(m, b) -} -func (m *SemanticalOneOfMessage_NonEmpty) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_SemanticalOneOfMessage_NonEmpty.Marshal(b, m, deterministic) -} -func (m *SemanticalOneOfMessage_NonEmpty) XXX_Merge(src proto.Message) { - xxx_messageInfo_SemanticalOneOfMessage_NonEmpty.Merge(m, src) -} -func (m *SemanticalOneOfMessage_NonEmpty) XXX_Size() int { - return xxx_messageInfo_SemanticalOneOfMessage_NonEmpty.Size(m) -} -func (m *SemanticalOneOfMessage_NonEmpty) XXX_DiscardUnknown() { - xxx_messageInfo_SemanticalOneOfMessage_NonEmpty.DiscardUnknown(m) -} - -var xxx_messageInfo_SemanticalOneOfMessage_NonEmpty proto.InternalMessageInfo - -func (m *SemanticalOneOfMessage_NonEmpty) GetBoolValue() bool { - if m != nil { - return m.BoolValue - } - return false -} - -func init() { - proto.RegisterType((*SemanticalMessage)(nil), "thethings.flags.test.SemanticalMessage") - proto.RegisterType((*SemanticalMessage_Empty)(nil), "thethings.flags.test.SemanticalMessage.Empty") - proto.RegisterType((*SemanticalMessage_NonEmpty)(nil), "thethings.flags.test.SemanticalMessage.NonEmpty") - proto.RegisterType((*SemanticalOneOfMessage)(nil), "thethings.flags.test.SemanticalOneOfMessage") - proto.RegisterType((*SemanticalOneOfMessage_Empty)(nil), "thethings.flags.test.SemanticalOneOfMessage.Empty") - proto.RegisterType((*SemanticalOneOfMessage_NonEmpty)(nil), "thethings.flags.test.SemanticalOneOfMessage.NonEmpty") -} - -func init() { proto.RegisterFile("message.proto", fileDescriptor_33c57e4bae7b9afd) } - -var fileDescriptor_33c57e4bae7b9afd = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcf, 0x6a, 0xc2, 0x40, - 0x10, 0xc6, 0x93, 0xb4, 0xa6, 0x71, 0xa5, 0x7f, 0x0c, 0xa5, 0x68, 0x40, 0x10, 0x4f, 0xbd, 0x24, - 0x11, 0xa5, 0x94, 0x7a, 0xb4, 0x14, 0xec, 0xc1, 0x0a, 0xa9, 0x14, 0xda, 0x43, 0x65, 0xd5, 0x71, - 0x13, 0x48, 0x76, 0x25, 0xbb, 0x11, 0xfa, 0x30, 0x7d, 0x01, 0x5f, 0xa9, 0x6f, 0xe1, 0x13, 0x94, - 0x6c, 0x92, 0x2a, 0xb4, 0xd0, 0x7f, 0xb7, 0x8f, 0x99, 0x9d, 0xdf, 0x7c, 0xf9, 0x32, 0xe8, 0x30, - 0x02, 0xce, 0x31, 0x01, 0x67, 0x19, 0x33, 0xc1, 0xcc, 0x53, 0xe1, 0x83, 0xf0, 0x03, 0x4a, 0xb8, - 0xb3, 0x08, 0x31, 0xe1, 0x8e, 0x00, 0x2e, 0xac, 0x2a, 0xa6, 0x94, 0x09, 0x2c, 0x02, 0x46, 0x79, - 0xf6, 0xd0, 0x6a, 0x04, 0x54, 0x40, 0x4c, 0x71, 0xe8, 0x12, 0x46, 0x98, 0xac, 0x49, 0x95, 0xb5, - 0x5b, 0x6f, 0x1a, 0xaa, 0xde, 0x43, 0x84, 0xa9, 0x08, 0x66, 0x38, 0x1c, 0x66, 0x3b, 0xcc, 0x6b, - 0x54, 0x82, 0x68, 0x29, 0x5e, 0x6a, 0x6a, 0x53, 0x3d, 0xaf, 0x74, 0x6c, 0xe7, 0xab, 0x6d, 0xce, - 0xa7, 0x39, 0xe7, 0x26, 0x1d, 0xf2, 0xb2, 0x59, 0xf3, 0x19, 0x1d, 0x4b, 0x31, 0x61, 0x2b, 0x88, - 0xe3, 0x24, 0x84, 0x79, 0x4d, 0xfb, 0x03, 0xae, 0xaf, 0x6f, 0xd6, 0x75, 0xad, 0xad, 0x78, 0x47, - 0x92, 0x36, 0x2a, 0x60, 0xe6, 0x10, 0x95, 0x29, 0xa3, 0x93, 0xcc, 0xe8, 0x9e, 0x24, 0xb7, 0x7f, - 0x4a, 0xbe, 0x63, 0x34, 0xf3, 0x6a, 0xd0, 0x5c, 0x59, 0x55, 0x54, 0x92, 0xa2, 0x67, 0x6c, 0xd6, - 0xf5, 0x7d, 0x43, 0x39, 0x51, 0xad, 0x2e, 0x32, 0x8a, 0x87, 0x66, 0x03, 0xa1, 0x29, 0x63, 0xe1, - 0x64, 0x85, 0xc3, 0x04, 0x64, 0x2e, 0x86, 0x57, 0x4e, 0x2b, 0x0f, 0x69, 0x61, 0x3b, 0xd4, 0x43, - 0x9b, 0x75, 0x5d, 0x4f, 0x55, 0x53, 0x6d, 0xbd, 0x6a, 0xe8, 0x6c, 0xbb, 0x7c, 0x44, 0x61, 0xb4, - 0x28, 0x22, 0x1e, 0x23, 0xc4, 0x3f, 0x3a, 0x79, 0xce, 0x9d, 0xef, 0xec, 0xef, 0x12, 0xb2, 0x74, - 0x06, 0x8a, 0xb7, 0xc3, 0x31, 0x1f, 0x51, 0x05, 0x87, 0xf2, 0x7f, 0x8b, 0x60, 0x05, 0x79, 0xde, - 0x17, 0xbf, 0xc2, 0x16, 0x5f, 0x3c, 0x50, 0xbc, 0x5d, 0x96, 0x75, 0x90, 0xe7, 0xf3, 0xef, 0x54, - 0xfa, 0x06, 0xd2, 0xd9, 0x32, 0xbd, 0xd1, 0xfe, 0xd5, 0xd3, 0x25, 0x09, 0x84, 0x9f, 0x4c, 0x9d, - 0x19, 0x8b, 0xdc, 0xb1, 0x0f, 0x63, 0xe9, 0xf2, 0x96, 0xce, 0x13, 0x2e, 0xe2, 0x00, 0xb8, 0x2b, - 0xaf, 0x74, 0x66, 0x13, 0xa0, 0x36, 0x61, 0xb6, 0x74, 0xef, 0xa6, 0xee, 0xa7, 0xba, 0xec, 0x74, - 0xdf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x10, 0xb5, 0x90, 0x79, 0x18, 0x03, 0x00, 0x00, -} diff --git a/test/gogo/message_flags.pb.go b/test/gogo/message_flags.pb.go deleted file mode 100644 index 8089af8..0000000 --- a/test/gogo/message_flags.pb.go +++ /dev/null @@ -1,137 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.9.1 -// source: message.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - pflag "github.com/spf13/pflag" -) - -// AddSetFlagsForSemanticalMessage_Empty adds flags to select fields in SemanticalMessage_Empty. -func AddSetFlagsForSemanticalMessage_Empty(flags *pflag.FlagSet, prefix string, hidden bool) { -} - -// SetFromFlags sets the SemanticalMessage_Empty message from flags. -func (m *SemanticalMessage_Empty) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - return paths, nil -} - -// AddSetFlagsForSemanticalMessage_NonEmpty adds flags to select fields in SemanticalMessage_NonEmpty. -func AddSetFlagsForSemanticalMessage_NonEmpty(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SemanticalMessage_NonEmpty message from flags. -func (m *SemanticalMessage_NonEmpty) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValue = val - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSemanticalMessage adds flags to select fields in SemanticalMessage. -func AddSetFlagsForSemanticalMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSemanticalMessage_Empty(flags, flagsplugin.Prefix("empty", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("empty", prefix), "", flagsplugin.WithHidden(hidden))) - AddSetFlagsForSemanticalMessage_Empty(flags, flagsplugin.Prefix("empty-overruled", prefix), hidden) - AddSetFlagsForSemanticalMessage_NonEmpty(flags, flagsplugin.Prefix("non-empty", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-empty", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SemanticalMessage message from flags. -func (m *SemanticalMessage) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("empty", prefix)); changed { - if m.Empty == nil { - m.Empty = &SemanticalMessage_Empty{} - } - if setPaths, err := m.Empty.SetFromFlags(flags, flagsplugin.Prefix("empty", prefix)); err != nil { - return nil, err - } else if len(setPaths) == 0 { - paths = append(paths, "empty") - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("empty_overruled", prefix)); changed { - if m.EmptyOverruled == nil { - m.EmptyOverruled = &SemanticalMessage_Empty{} - } - if setPaths, err := m.EmptyOverruled.SetFromFlags(flags, flagsplugin.Prefix("empty_overruled", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("non_empty", prefix)); changed { - if m.NonEmpty == nil { - m.NonEmpty = &SemanticalMessage_NonEmpty{} - } - if setPaths, err := m.NonEmpty.SetFromFlags(flags, flagsplugin.Prefix("non_empty", prefix)); err != nil { - return nil, err - } else if len(setPaths) == 0 { - paths = append(paths, "non_empty") - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} - -// AddSetFlagsForSemanticalOneOfMessage_NonEmpty adds flags to select fields in SemanticalOneOfMessage_NonEmpty. -func AddSetFlagsForSemanticalOneOfMessage_NonEmpty(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SemanticalOneOfMessage_NonEmpty message from flags. -func (m *SemanticalOneOfMessage_NonEmpty) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValue = val - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSemanticalOneOfMessage adds flags to select fields in SemanticalOneOfMessage. -func AddSetFlagsForSemanticalOneOfMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("option.semantical", prefix), "", flagsplugin.WithHidden(hidden))) - AddSetFlagsForSemanticalOneOfMessage_NonEmpty(flags, flagsplugin.Prefix("option.alternative", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("option.alternative", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SemanticalOneOfMessage message from flags. -func (m *SemanticalOneOfMessage) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if _, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("option.semantical", prefix)); err != nil { - return nil, err - } else if changed { - ov := &SemanticalOneOfMessage_Semantical{} - if ov.Semantical == nil { - ov.Semantical = &SemanticalOneOfMessage_Empty{} - } - paths = append(paths, flagsplugin.Prefix("option.semantical", prefix)) - m.Option = ov - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("option.alternative", prefix)); changed { - ov := &SemanticalOneOfMessage_Alternative{} - if ov.Alternative == nil { - ov.Alternative = &SemanticalOneOfMessage_NonEmpty{} - } - if setPaths, err := ov.Alternative.SetFromFlags(flags, flagsplugin.Prefix("option.alternative", prefix)); err != nil { - return nil, err - } else if len(setPaths) == 0 { - paths = append(paths, "option.alternative") - } else { - paths = append(paths, setPaths...) - } - m.Option = ov - } - return paths, nil -} diff --git a/test/gogo/message_test.go b/test/gogo/message_test.go deleted file mode 100644 index 124ae37..0000000 --- a/test/gogo/message_test.go +++ /dev/null @@ -1,130 +0,0 @@ -package test_test - -import ( - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/gogo" - pflag "github.com/spf13/pflag" -) - -var testMessagesWithSemanticalMeaning = []struct { - name string - arguments []string - expectedMessage SemanticalMessage - expectedMask []string -}{ - { - name: "exists", - arguments: []string{"--empty"}, - expectedMessage: SemanticalMessage{ - Empty: &SemanticalMessage_Empty{}, - }, - expectedMask: []string{"empty"}, - }, - { - name: "doesn't exist", - arguments: []string{}, - expectedMessage: SemanticalMessage{ - Empty: nil, - EmptyOverruled: nil, - NonEmpty: nil, - }, - expectedMask: nil, - }, - { - name: "overruled semantical", - arguments: []string{"--empty_overruled"}, - expectedMessage: SemanticalMessage{ - Empty: nil, - EmptyOverruled: nil, - NonEmpty: nil, - }, - expectedMask: nil, - }, - { - name: "non_empty semantical", - arguments: []string{"--non-empty"}, - expectedMessage: SemanticalMessage{ - NonEmpty: &SemanticalMessage_NonEmpty{}, - }, - expectedMask: []string{"non_empty"}, - }, - { - name: "non_empty with value", - arguments: []string{"--non-empty.bool-value", "true"}, - expectedMessage: SemanticalMessage{ - NonEmpty: &SemanticalMessage_NonEmpty{ - BoolValue: true, - }, - }, - expectedMask: []string{"non_empty.bool_value"}, - }, -} - -var testMessagesWithOneOfSemanticalMeaning = []struct { - name string - arguments []string - expectedMessage SemanticalOneOfMessage - expectedMask []string -}{ - { - name: "alternative exists", - arguments: []string{"--option.alternative"}, - expectedMessage: SemanticalOneOfMessage{ - Option: &SemanticalOneOfMessage_Alternative{ - Alternative: &SemanticalOneOfMessage_NonEmpty{}, - }, - }, - expectedMask: []string{"option.alternative"}, - }, - { - name: "doesn't exist", - arguments: []string{}, - expectedMessage: SemanticalOneOfMessage{ - Option: nil, - }, - expectedMask: nil, - }, - { - name: "semantical exists", - arguments: []string{"--option.semantical"}, - expectedMessage: SemanticalOneOfMessage{ - Option: &SemanticalOneOfMessage_Semantical{ - Semantical: &SemanticalOneOfMessage_Empty{}, - }, - }, - expectedMask: []string{"option.semantical"}, - }, - { - name: "alternative exists with value", - arguments: []string{"--option.alternative.bool-value", "true"}, - expectedMessage: SemanticalOneOfMessage{ - Option: &SemanticalOneOfMessage_Alternative{ - Alternative: &SemanticalOneOfMessage_NonEmpty{ - BoolValue: true, - }, - }, - }, - expectedMask: []string{"option.alternative.bool_value"}, - }, -} - -func TestSetFlagsMessageWithSemanticalMeaning(t *testing.T) { - for _, tt := range testMessagesWithSemanticalMeaning { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForSemanticalMessage(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithOneOfSemanticalMeaning(t *testing.T) { - for _, tt := range testMessagesWithOneOfSemanticalMeaning { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForSemanticalOneOfMessage(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/gogo/scalars.pb.go b/test/gogo/scalars.pb.go deleted file mode 100644 index 0adf414..0000000 --- a/test/gogo/scalars.pb.go +++ /dev/null @@ -1,941 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: scalars.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - proto "github.com/gogo/protobuf/proto" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MessageWithScalars struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - DoubleValues []float64 `protobuf:"fixed64,2,rep,packed,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` - FloatValue float32 `protobuf:"fixed32,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` - FloatValues []float32 `protobuf:"fixed32,4,rep,packed,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` - Int32Value int32 `protobuf:"varint,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` - Int32Values []int32 `protobuf:"varint,6,rep,packed,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` - Int64Value int64 `protobuf:"varint,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` - Int64Values []int64 `protobuf:"varint,8,rep,packed,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` - Uint32Value uint32 `protobuf:"varint,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` - Uint32Values []uint32 `protobuf:"varint,10,rep,packed,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` - Uint64Value uint64 `protobuf:"varint,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` - Uint64Values []uint64 `protobuf:"varint,12,rep,packed,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` - Sint32Value int32 `protobuf:"zigzag32,13,opt,name=sint32_value,json=sint32Value,proto3" json:"sint32_value,omitempty"` - Sint32Values []int32 `protobuf:"zigzag32,14,rep,packed,name=sint32_values,json=sint32Values,proto3" json:"sint32_values,omitempty"` - Sint64Value int64 `protobuf:"zigzag64,15,opt,name=sint64_value,json=sint64Value,proto3" json:"sint64_value,omitempty"` - Sint64Values []int64 `protobuf:"zigzag64,16,rep,packed,name=sint64_values,json=sint64Values,proto3" json:"sint64_values,omitempty"` - Fixed32Value uint32 `protobuf:"fixed32,17,opt,name=fixed32_value,json=fixed32Value,proto3" json:"fixed32_value,omitempty"` - Fixed32Values []uint32 `protobuf:"fixed32,18,rep,packed,name=fixed32_values,json=fixed32Values,proto3" json:"fixed32_values,omitempty"` - Fixed64Value uint64 `protobuf:"fixed64,19,opt,name=fixed64_value,json=fixed64Value,proto3" json:"fixed64_value,omitempty"` - Fixed64Values []uint64 `protobuf:"fixed64,20,rep,packed,name=fixed64_values,json=fixed64Values,proto3" json:"fixed64_values,omitempty"` - Sfixed32Value int32 `protobuf:"fixed32,21,opt,name=sfixed32_value,json=sfixed32Value,proto3" json:"sfixed32_value,omitempty"` - Sfixed32Values []int32 `protobuf:"fixed32,22,rep,packed,name=sfixed32_values,json=sfixed32Values,proto3" json:"sfixed32_values,omitempty"` - Sfixed64Value int64 `protobuf:"fixed64,23,opt,name=sfixed64_value,json=sfixed64Value,proto3" json:"sfixed64_value,omitempty"` - Sfixed64Values []int64 `protobuf:"fixed64,24,rep,packed,name=sfixed64_values,json=sfixed64Values,proto3" json:"sfixed64_values,omitempty"` - BoolValue bool `protobuf:"varint,25,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - BoolValues []bool `protobuf:"varint,26,rep,packed,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` - StringValue string `protobuf:"bytes,27,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - StringValues []string `protobuf:"bytes,28,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` - BytesValue []byte `protobuf:"bytes,29,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` - BytesValues [][]byte `protobuf:"bytes,30,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` - HexBytesValue []byte `protobuf:"bytes,31,opt,name=hex_bytes_value,json=hexBytesValue,proto3" json:"hex_bytes_value,omitempty"` - HexBytesValues [][]byte `protobuf:"bytes,32,rep,name=hex_bytes_values,json=hexBytesValues,proto3" json:"hex_bytes_values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithScalars) Reset() { *m = MessageWithScalars{} } -func (m *MessageWithScalars) String() string { return proto.CompactTextString(m) } -func (*MessageWithScalars) ProtoMessage() {} -func (*MessageWithScalars) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{0} -} -func (m *MessageWithScalars) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithScalars.Unmarshal(m, b) -} -func (m *MessageWithScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithScalars.Marshal(b, m, deterministic) -} -func (m *MessageWithScalars) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithScalars.Merge(m, src) -} -func (m *MessageWithScalars) XXX_Size() int { - return xxx_messageInfo_MessageWithScalars.Size(m) -} -func (m *MessageWithScalars) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithScalars.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithScalars proto.InternalMessageInfo - -func (m *MessageWithScalars) GetDoubleValue() float64 { - if m != nil { - return m.DoubleValue - } - return 0 -} - -func (m *MessageWithScalars) GetDoubleValues() []float64 { - if m != nil { - return m.DoubleValues - } - return nil -} - -func (m *MessageWithScalars) GetFloatValue() float32 { - if m != nil { - return m.FloatValue - } - return 0 -} - -func (m *MessageWithScalars) GetFloatValues() []float32 { - if m != nil { - return m.FloatValues - } - return nil -} - -func (m *MessageWithScalars) GetInt32Value() int32 { - if m != nil { - return m.Int32Value - } - return 0 -} - -func (m *MessageWithScalars) GetInt32Values() []int32 { - if m != nil { - return m.Int32Values - } - return nil -} - -func (m *MessageWithScalars) GetInt64Value() int64 { - if m != nil { - return m.Int64Value - } - return 0 -} - -func (m *MessageWithScalars) GetInt64Values() []int64 { - if m != nil { - return m.Int64Values - } - return nil -} - -func (m *MessageWithScalars) GetUint32Value() uint32 { - if m != nil { - return m.Uint32Value - } - return 0 -} - -func (m *MessageWithScalars) GetUint32Values() []uint32 { - if m != nil { - return m.Uint32Values - } - return nil -} - -func (m *MessageWithScalars) GetUint64Value() uint64 { - if m != nil { - return m.Uint64Value - } - return 0 -} - -func (m *MessageWithScalars) GetUint64Values() []uint64 { - if m != nil { - return m.Uint64Values - } - return nil -} - -func (m *MessageWithScalars) GetSint32Value() int32 { - if m != nil { - return m.Sint32Value - } - return 0 -} - -func (m *MessageWithScalars) GetSint32Values() []int32 { - if m != nil { - return m.Sint32Values - } - return nil -} - -func (m *MessageWithScalars) GetSint64Value() int64 { - if m != nil { - return m.Sint64Value - } - return 0 -} - -func (m *MessageWithScalars) GetSint64Values() []int64 { - if m != nil { - return m.Sint64Values - } - return nil -} - -func (m *MessageWithScalars) GetFixed32Value() uint32 { - if m != nil { - return m.Fixed32Value - } - return 0 -} - -func (m *MessageWithScalars) GetFixed32Values() []uint32 { - if m != nil { - return m.Fixed32Values - } - return nil -} - -func (m *MessageWithScalars) GetFixed64Value() uint64 { - if m != nil { - return m.Fixed64Value - } - return 0 -} - -func (m *MessageWithScalars) GetFixed64Values() []uint64 { - if m != nil { - return m.Fixed64Values - } - return nil -} - -func (m *MessageWithScalars) GetSfixed32Value() int32 { - if m != nil { - return m.Sfixed32Value - } - return 0 -} - -func (m *MessageWithScalars) GetSfixed32Values() []int32 { - if m != nil { - return m.Sfixed32Values - } - return nil -} - -func (m *MessageWithScalars) GetSfixed64Value() int64 { - if m != nil { - return m.Sfixed64Value - } - return 0 -} - -func (m *MessageWithScalars) GetSfixed64Values() []int64 { - if m != nil { - return m.Sfixed64Values - } - return nil -} - -func (m *MessageWithScalars) GetBoolValue() bool { - if m != nil { - return m.BoolValue - } - return false -} - -func (m *MessageWithScalars) GetBoolValues() []bool { - if m != nil { - return m.BoolValues - } - return nil -} - -func (m *MessageWithScalars) GetStringValue() string { - if m != nil { - return m.StringValue - } - return "" -} - -func (m *MessageWithScalars) GetStringValues() []string { - if m != nil { - return m.StringValues - } - return nil -} - -func (m *MessageWithScalars) GetBytesValue() []byte { - if m != nil { - return m.BytesValue - } - return nil -} - -func (m *MessageWithScalars) GetBytesValues() [][]byte { - if m != nil { - return m.BytesValues - } - return nil -} - -func (m *MessageWithScalars) GetHexBytesValue() []byte { - if m != nil { - return m.HexBytesValue - } - return nil -} - -func (m *MessageWithScalars) GetHexBytesValues() [][]byte { - if m != nil { - return m.HexBytesValues - } - return nil -} - -type MessageWithOneofScalars struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofScalars_DoubleValue - // *MessageWithOneofScalars_FloatValue - // *MessageWithOneofScalars_Int32Value - // *MessageWithOneofScalars_Int64Value - // *MessageWithOneofScalars_Uint32Value - // *MessageWithOneofScalars_Uint64Value - // *MessageWithOneofScalars_Sint32Value - // *MessageWithOneofScalars_Sint64Value - // *MessageWithOneofScalars_Fixed32Value - // *MessageWithOneofScalars_Fixed64Value - // *MessageWithOneofScalars_Sfixed32Value - // *MessageWithOneofScalars_Sfixed64Value - // *MessageWithOneofScalars_BoolValue - // *MessageWithOneofScalars_StringValue - // *MessageWithOneofScalars_BytesValue - // *MessageWithOneofScalars_HexBytesValue - Value isMessageWithOneofScalars_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofScalars) Reset() { *m = MessageWithOneofScalars{} } -func (m *MessageWithOneofScalars) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofScalars) ProtoMessage() {} -func (*MessageWithOneofScalars) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{1} -} -func (m *MessageWithOneofScalars) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofScalars.Unmarshal(m, b) -} -func (m *MessageWithOneofScalars) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofScalars.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofScalars) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofScalars.Merge(m, src) -} -func (m *MessageWithOneofScalars) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofScalars.Size(m) -} -func (m *MessageWithOneofScalars) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofScalars.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofScalars proto.InternalMessageInfo - -type isMessageWithOneofScalars_Value interface { - isMessageWithOneofScalars_Value() -} - -type MessageWithOneofScalars_DoubleValue struct { - DoubleValue float64 `protobuf:"fixed64,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` -} -type MessageWithOneofScalars_FloatValue struct { - FloatValue float32 `protobuf:"fixed32,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` -} -type MessageWithOneofScalars_Int32Value struct { - Int32Value int32 `protobuf:"varint,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` -} -type MessageWithOneofScalars_Int64Value struct { - Int64Value int64 `protobuf:"varint,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` -} -type MessageWithOneofScalars_Uint32Value struct { - Uint32Value uint32 `protobuf:"varint,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` -} -type MessageWithOneofScalars_Uint64Value struct { - Uint64Value uint64 `protobuf:"varint,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` -} -type MessageWithOneofScalars_Sint32Value struct { - Sint32Value int32 `protobuf:"zigzag32,7,opt,name=sint32_value,json=sint32Value,proto3,oneof" json:"sint32_value,omitempty"` -} -type MessageWithOneofScalars_Sint64Value struct { - Sint64Value int64 `protobuf:"zigzag64,8,opt,name=sint64_value,json=sint64Value,proto3,oneof" json:"sint64_value,omitempty"` -} -type MessageWithOneofScalars_Fixed32Value struct { - Fixed32Value uint32 `protobuf:"fixed32,9,opt,name=fixed32_value,json=fixed32Value,proto3,oneof" json:"fixed32_value,omitempty"` -} -type MessageWithOneofScalars_Fixed64Value struct { - Fixed64Value uint64 `protobuf:"fixed64,10,opt,name=fixed64_value,json=fixed64Value,proto3,oneof" json:"fixed64_value,omitempty"` -} -type MessageWithOneofScalars_Sfixed32Value struct { - Sfixed32Value int32 `protobuf:"fixed32,11,opt,name=sfixed32_value,json=sfixed32Value,proto3,oneof" json:"sfixed32_value,omitempty"` -} -type MessageWithOneofScalars_Sfixed64Value struct { - Sfixed64Value int64 `protobuf:"fixed64,12,opt,name=sfixed64_value,json=sfixed64Value,proto3,oneof" json:"sfixed64_value,omitempty"` -} -type MessageWithOneofScalars_BoolValue struct { - BoolValue bool `protobuf:"varint,13,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` -} -type MessageWithOneofScalars_StringValue struct { - StringValue string `protobuf:"bytes,14,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` -} -type MessageWithOneofScalars_BytesValue struct { - BytesValue []byte `protobuf:"bytes,15,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` -} -type MessageWithOneofScalars_HexBytesValue struct { - HexBytesValue []byte `protobuf:"bytes,16,opt,name=hex_bytes_value,json=hexBytesValue,proto3,oneof" json:"hex_bytes_value,omitempty"` -} - -func (*MessageWithOneofScalars_DoubleValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_FloatValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Int32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Int64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Uint32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Uint64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sint32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sint64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Fixed32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Fixed64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sfixed32Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_Sfixed64Value) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_BoolValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_StringValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_BytesValue) isMessageWithOneofScalars_Value() {} -func (*MessageWithOneofScalars_HexBytesValue) isMessageWithOneofScalars_Value() {} - -func (m *MessageWithOneofScalars) GetValue() isMessageWithOneofScalars_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofScalars) GetDoubleValue() float64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_DoubleValue); ok { - return x.DoubleValue - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFloatValue() float32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_FloatValue); ok { - return x.FloatValue - } - return 0 -} - -func (m *MessageWithOneofScalars) GetInt32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Int32Value); ok { - return x.Int32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetInt64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Int64Value); ok { - return x.Int64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetUint32Value() uint32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint32Value); ok { - return x.Uint32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetUint64Value() uint64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Uint64Value); ok { - return x.Uint64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSint32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint32Value); ok { - return x.Sint32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSint64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sint64Value); ok { - return x.Sint64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFixed32Value() uint32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed32Value); ok { - return x.Fixed32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetFixed64Value() uint64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Fixed64Value); ok { - return x.Fixed64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSfixed32Value() int32 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed32Value); ok { - return x.Sfixed32Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetSfixed64Value() int64 { - if x, ok := m.GetValue().(*MessageWithOneofScalars_Sfixed64Value); ok { - return x.Sfixed64Value - } - return 0 -} - -func (m *MessageWithOneofScalars) GetBoolValue() bool { - if x, ok := m.GetValue().(*MessageWithOneofScalars_BoolValue); ok { - return x.BoolValue - } - return false -} - -func (m *MessageWithOneofScalars) GetStringValue() string { - if x, ok := m.GetValue().(*MessageWithOneofScalars_StringValue); ok { - return x.StringValue - } - return "" -} - -func (m *MessageWithOneofScalars) GetBytesValue() []byte { - if x, ok := m.GetValue().(*MessageWithOneofScalars_BytesValue); ok { - return x.BytesValue - } - return nil -} - -func (m *MessageWithOneofScalars) GetHexBytesValue() []byte { - if x, ok := m.GetValue().(*MessageWithOneofScalars_HexBytesValue); ok { - return x.HexBytesValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofScalars) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofScalars_DoubleValue)(nil), - (*MessageWithOneofScalars_FloatValue)(nil), - (*MessageWithOneofScalars_Int32Value)(nil), - (*MessageWithOneofScalars_Int64Value)(nil), - (*MessageWithOneofScalars_Uint32Value)(nil), - (*MessageWithOneofScalars_Uint64Value)(nil), - (*MessageWithOneofScalars_Sint32Value)(nil), - (*MessageWithOneofScalars_Sint64Value)(nil), - (*MessageWithOneofScalars_Fixed32Value)(nil), - (*MessageWithOneofScalars_Fixed64Value)(nil), - (*MessageWithOneofScalars_Sfixed32Value)(nil), - (*MessageWithOneofScalars_Sfixed64Value)(nil), - (*MessageWithOneofScalars_BoolValue)(nil), - (*MessageWithOneofScalars_StringValue)(nil), - (*MessageWithOneofScalars_BytesValue)(nil), - (*MessageWithOneofScalars_HexBytesValue)(nil), - } -} - -type MessageWithScalarMaps struct { - StringDoubleMap map[string]float64 `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - StringFloatMap map[string]float32 `protobuf:"bytes,3,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - StringInt32Map map[string]int32 `protobuf:"bytes,5,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Int32StringMap map[int32]string `protobuf:"bytes,6,rep,name=int32_string_map,json=int32StringMap,proto3" json:"int32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt64Map map[string]int64 `protobuf:"bytes,7,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Int64StringMap map[int64]string `protobuf:"bytes,8,rep,name=int64_string_map,json=int64StringMap,proto3" json:"int64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint32Map map[string]uint32 `protobuf:"bytes,9,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint32StringMap map[uint32]string `protobuf:"bytes,10,rep,name=uint32_string_map,json=uint32StringMap,proto3" json:"uint32_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint64Map map[string]uint64 `protobuf:"bytes,11,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - Uint64StringMap map[uint64]string `protobuf:"bytes,12,rep,name=uint64_string_map,json=uint64StringMap,proto3" json:"uint64_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSint32Map map[string]int32 `protobuf:"bytes,13,rep,name=string_sint32_map,json=stringSint32Map,proto3" json:"string_sint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag32,2,opt,name=value,proto3"` - Sint32StringMap map[int32]string `protobuf:"bytes,14,rep,name=sint32_string_map,json=sint32StringMap,proto3" json:"sint32_string_map,omitempty" protobuf_key:"zigzag32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSint64Map map[string]int64 `protobuf:"bytes,15,rep,name=string_sint64_map,json=stringSint64Map,proto3" json:"string_sint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"zigzag64,2,opt,name=value,proto3"` - Sint64StringMap map[int64]string `protobuf:"bytes,16,rep,name=sint64_string_map,json=sint64StringMap,proto3" json:"sint64_string_map,omitempty" protobuf_key:"zigzag64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFixed32Map map[string]uint32 `protobuf:"bytes,17,rep,name=string_fixed32_map,json=stringFixed32Map,proto3" json:"string_fixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Fixed32StringMap map[uint32]string `protobuf:"bytes,18,rep,name=fixed32_string_map,json=fixed32StringMap,proto3" json:"fixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFixed64Map map[string]uint64 `protobuf:"bytes,19,rep,name=string_fixed64_map,json=stringFixed64Map,proto3" json:"string_fixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - Fixed64StringMap map[uint64]string `protobuf:"bytes,20,rep,name=fixed64_string_map,json=fixed64StringMap,proto3" json:"fixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSfixed32Map map[string]int32 `protobuf:"bytes,21,rep,name=string_sfixed32_map,json=stringSfixed32Map,proto3" json:"string_sfixed32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"` - Sfixed32StringMap map[int32]string `protobuf:"bytes,22,rep,name=sfixed32_string_map,json=sfixed32StringMap,proto3" json:"sfixed32_string_map,omitempty" protobuf_key:"fixed32,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringSfixed64Map map[string]int64 `protobuf:"bytes,23,rep,name=string_sfixed64_map,json=stringSfixed64Map,proto3" json:"string_sfixed64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed64,2,opt,name=value,proto3"` - Sfixed64StringMap map[int64]string `protobuf:"bytes,24,rep,name=sfixed64_string_map,json=sfixed64StringMap,proto3" json:"sfixed64_string_map,omitempty" protobuf_key:"fixed64,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBoolMap map[string]bool `protobuf:"bytes,25,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` - BoolStringMap map[bool]string `protobuf:"bytes,26,rep,name=bool_string_map,json=boolStringMap,proto3" json:"bool_string_map,omitempty" protobuf_key:"varint,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStringMap map[string]string `protobuf:"bytes,27,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBytesMap map[string][]byte `protobuf:"bytes,29,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithScalarMaps) Reset() { *m = MessageWithScalarMaps{} } -func (m *MessageWithScalarMaps) String() string { return proto.CompactTextString(m) } -func (*MessageWithScalarMaps) ProtoMessage() {} -func (*MessageWithScalarMaps) Descriptor() ([]byte, []int) { - return fileDescriptor_5d1bcd1a4bdfc194, []int{2} -} -func (m *MessageWithScalarMaps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithScalarMaps.Unmarshal(m, b) -} -func (m *MessageWithScalarMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithScalarMaps.Marshal(b, m, deterministic) -} -func (m *MessageWithScalarMaps) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithScalarMaps.Merge(m, src) -} -func (m *MessageWithScalarMaps) XXX_Size() int { - return xxx_messageInfo_MessageWithScalarMaps.Size(m) -} -func (m *MessageWithScalarMaps) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithScalarMaps.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithScalarMaps proto.InternalMessageInfo - -func (m *MessageWithScalarMaps) GetStringDoubleMap() map[string]float64 { - if m != nil { - return m.StringDoubleMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFloatMap() map[string]float32 { - if m != nil { - return m.StringFloatMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringInt32Map() map[string]int32 { - if m != nil { - return m.StringInt32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetInt32StringMap() map[int32]string { - if m != nil { - return m.Int32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringInt64Map() map[string]int64 { - if m != nil { - return m.StringInt64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetInt64StringMap() map[int64]string { - if m != nil { - return m.Int64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringUint32Map() map[string]uint32 { - if m != nil { - return m.StringUint32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetUint32StringMap() map[uint32]string { - if m != nil { - return m.Uint32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringUint64Map() map[string]uint64 { - if m != nil { - return m.StringUint64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetUint64StringMap() map[uint64]string { - if m != nil { - return m.Uint64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSint32Map() map[string]int32 { - if m != nil { - return m.StringSint32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSint32StringMap() map[int32]string { - if m != nil { - return m.Sint32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSint64Map() map[string]int64 { - if m != nil { - return m.StringSint64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSint64StringMap() map[int64]string { - if m != nil { - return m.Sint64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFixed32Map() map[string]uint32 { - if m != nil { - return m.StringFixed32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetFixed32StringMap() map[uint32]string { - if m != nil { - return m.Fixed32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringFixed64Map() map[string]uint64 { - if m != nil { - return m.StringFixed64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetFixed64StringMap() map[uint64]string { - if m != nil { - return m.Fixed64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSfixed32Map() map[string]int32 { - if m != nil { - return m.StringSfixed32Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSfixed32StringMap() map[int32]string { - if m != nil { - return m.Sfixed32StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringSfixed64Map() map[string]int64 { - if m != nil { - return m.StringSfixed64Map - } - return nil -} - -func (m *MessageWithScalarMaps) GetSfixed64StringMap() map[int64]string { - if m != nil { - return m.Sfixed64StringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringBoolMap() map[string]bool { - if m != nil { - return m.StringBoolMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetBoolStringMap() map[bool]string { - if m != nil { - return m.BoolStringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringStringMap() map[string]string { - if m != nil { - return m.StringStringMap - } - return nil -} - -func (m *MessageWithScalarMaps) GetStringBytesMap() map[string][]byte { - if m != nil { - return m.StringBytesMap - } - return nil -} - -func init() { - proto.RegisterType((*MessageWithScalars)(nil), "thethings.flags.test.MessageWithScalars") - proto.RegisterType((*MessageWithOneofScalars)(nil), "thethings.flags.test.MessageWithOneofScalars") - proto.RegisterType((*MessageWithScalarMaps)(nil), "thethings.flags.test.MessageWithScalarMaps") - proto.RegisterMapType((map[bool]string)(nil), "thethings.flags.test.MessageWithScalarMaps.BoolStringMapEntry") - proto.RegisterMapType((map[uint32]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Fixed32StringMapEntry") - proto.RegisterMapType((map[uint64]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Fixed64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Int32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Int64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Sfixed32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Sfixed64StringMapEntry") - proto.RegisterMapType((map[int32]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Sint32StringMapEntry") - proto.RegisterMapType((map[int64]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Sint64StringMapEntry") - proto.RegisterMapType((map[string]bool)(nil), "thethings.flags.test.MessageWithScalarMaps.StringBoolMapEntry") - proto.RegisterMapType((map[string][]byte)(nil), "thethings.flags.test.MessageWithScalarMaps.StringBytesMapEntry") - proto.RegisterMapType((map[string]float64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringDoubleMapEntry") - proto.RegisterMapType((map[string]uint32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringFixed32MapEntry") - proto.RegisterMapType((map[string]uint64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringFixed64MapEntry") - proto.RegisterMapType((map[string]float32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringFloatMapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringInt32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringInt64MapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringSfixed32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringSfixed64MapEntry") - proto.RegisterMapType((map[string]int32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringSint32MapEntry") - proto.RegisterMapType((map[string]int64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringSint64MapEntry") - proto.RegisterMapType((map[string]string)(nil), "thethings.flags.test.MessageWithScalarMaps.StringStringMapEntry") - proto.RegisterMapType((map[string]uint32)(nil), "thethings.flags.test.MessageWithScalarMaps.StringUint32MapEntry") - proto.RegisterMapType((map[string]uint64)(nil), "thethings.flags.test.MessageWithScalarMaps.StringUint64MapEntry") - proto.RegisterMapType((map[uint32]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Uint32StringMapEntry") - proto.RegisterMapType((map[uint64]string)(nil), "thethings.flags.test.MessageWithScalarMaps.Uint64StringMapEntry") -} - -func init() { proto.RegisterFile("scalars.proto", fileDescriptor_5d1bcd1a4bdfc194) } - -var fileDescriptor_5d1bcd1a4bdfc194 = []byte{ - // 1541 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x58, 0xcf, 0x6f, 0xdc, 0x44, - 0x18, 0xcd, 0xc4, 0xfb, 0x73, 0x6c, 0xef, 0x0f, 0x27, 0x69, 0x37, 0x5b, 0x4a, 0x26, 0x09, 0x88, - 0xb9, 0x74, 0x2b, 0xb5, 0x51, 0x80, 0x1e, 0xa0, 0x5d, 0x4a, 0x9b, 0x4a, 0xb4, 0x48, 0xb3, 0x2d, - 0x48, 0x5c, 0xaa, 0x4d, 0xea, 0xdd, 0xb5, 0xd8, 0xae, 0xa3, 0x8c, 0x0d, 0xcd, 0x9f, 0xc2, 0x85, - 0x4b, 0x2f, 0xa8, 0xff, 0x03, 0x67, 0xc4, 0x99, 0xff, 0xa4, 0x07, 0xce, 0x68, 0xc6, 0x63, 0x7b, - 0x66, 0xec, 0xc4, 0xbb, 0x4e, 0x2f, 0x5c, 0x10, 0xfd, 0xf2, 0xe9, 0x7d, 0xef, 0xcd, 0xf3, 0xbc, - 0xf9, 0x12, 0x68, 0xd3, 0x93, 0xf1, 0x7c, 0x7c, 0x46, 0x07, 0xa7, 0x67, 0x7e, 0xe0, 0x3b, 0x9b, - 0xc1, 0xcc, 0x0d, 0x66, 0xde, 0x62, 0x4a, 0x07, 0x93, 0xf9, 0x78, 0x4a, 0x07, 0x81, 0x4b, 0x83, - 0x7e, 0x77, 0xbc, 0x58, 0xf8, 0xc1, 0x38, 0xf0, 0xfc, 0x85, 0x68, 0xdc, 0xfb, 0xd7, 0x84, 0xce, - 0x53, 0x97, 0xd2, 0xf1, 0xd4, 0xfd, 0xd1, 0x0b, 0x66, 0xa3, 0x08, 0xc5, 0xd9, 0x85, 0xd6, 0x2b, - 0x3f, 0x3c, 0x9e, 0xbb, 0x2f, 0x7f, 0x19, 0xcf, 0x43, 0xb7, 0x07, 0x10, 0xc0, 0x80, 0x98, 0x51, - 0xed, 0x07, 0x56, 0x72, 0xf6, 0xa1, 0x2d, 0xb7, 0xd0, 0xde, 0x3a, 0x32, 0x30, 0x20, 0x96, 0xd4, - 0x43, 0x9d, 0x1d, 0x68, 0x4e, 0xe6, 0xfe, 0x38, 0x10, 0x30, 0x06, 0x02, 0x78, 0x9d, 0x40, 0x5e, - 0x8a, 0x50, 0x76, 0xa1, 0x25, 0x35, 0xd0, 0x5e, 0x05, 0x19, 0x78, 0x9d, 0x98, 0x69, 0x07, 0xc7, - 0xf0, 0x16, 0xc1, 0xdd, 0x3b, 0x02, 0xa3, 0x8a, 0x00, 0xae, 0x12, 0xc8, 0x4b, 0x09, 0x86, 0xd4, - 0x40, 0x7b, 0x35, 0x64, 0xe0, 0x2a, 0x31, 0xd3, 0x8e, 0x18, 0xe3, 0xf0, 0x40, 0x60, 0xd4, 0x11, - 0xc0, 0x06, 0xc7, 0x38, 0x3c, 0x90, 0x31, 0xe2, 0x06, 0xda, 0x6b, 0x20, 0x03, 0x1b, 0xc4, 0x4c, - 0x3b, 0xf8, 0x99, 0x84, 0x32, 0x91, 0x26, 0x02, 0xd8, 0x26, 0x66, 0x28, 0x31, 0xd9, 0x87, 0x76, - 0xa8, 0x50, 0x81, 0xc8, 0xc0, 0x36, 0xb1, 0x42, 0x99, 0x8b, 0xc0, 0x49, 0xc8, 0x98, 0x08, 0xe0, - 0x4a, 0x84, 0x13, 0xb3, 0x11, 0x38, 0x29, 0x1d, 0x0b, 0x19, 0xb8, 0x42, 0xac, 0x50, 0xe3, 0x43, - 0x65, 0x3e, 0x36, 0x02, 0xb8, 0x4b, 0x4c, 0xaa, 0xf2, 0xa1, 0x0a, 0x9f, 0x16, 0x32, 0x70, 0x97, - 0x58, 0x54, 0xe3, 0x43, 0x65, 0x3e, 0x6d, 0x04, 0xb0, 0x13, 0xe1, 0x48, 0x7c, 0xa8, 0xc2, 0xa7, - 0x83, 0x0c, 0xec, 0x10, 0x8b, 0xca, 0x7c, 0xf6, 0xa1, 0x3d, 0xf1, 0xde, 0xb8, 0xaf, 0x12, 0x42, - 0x5d, 0x04, 0x70, 0x9d, 0x58, 0xa2, 0x18, 0x21, 0x7d, 0x0a, 0x5b, 0x4a, 0x13, 0xed, 0x39, 0xc8, - 0xc0, 0x75, 0x62, 0xcb, 0x5d, 0x29, 0x56, 0x42, 0x6a, 0x03, 0x01, 0x5c, 0x13, 0x58, 0x31, 0xab, - 0x18, 0x2b, 0xa5, 0xb5, 0x89, 0x0c, 0x5c, 0x23, 0xb6, 0xdc, 0x45, 0x59, 0x1b, 0x55, 0x89, 0x6d, - 0x21, 0x80, 0xdb, 0xc4, 0xa6, 0x0a, 0xb3, 0xcf, 0x60, 0x9b, 0x6a, 0xd4, 0xae, 0x21, 0x03, 0xb7, - 0x49, 0x8b, 0xaa, 0xdc, 0x12, 0xbc, 0x84, 0xdc, 0x75, 0x04, 0x70, 0x27, 0xc6, 0x8b, 0xd9, 0x25, - 0x78, 0x29, 0xbd, 0x1e, 0x32, 0x70, 0x87, 0xb4, 0xa8, 0xca, 0xef, 0x26, 0x84, 0xc7, 0xbe, 0x3f, - 0x17, 0x58, 0xdb, 0x08, 0xe0, 0x06, 0x69, 0xb2, 0x4a, 0x84, 0xb3, 0x03, 0xcd, 0xf4, 0xc7, 0xb4, - 0xd7, 0x47, 0x06, 0x6e, 0x10, 0x98, 0xfc, 0x3c, 0xf2, 0x2f, 0x38, 0xf3, 0x16, 0x53, 0x81, 0x70, - 0x03, 0x01, 0xdc, 0x24, 0x66, 0x54, 0x4b, 0xfd, 0x93, 0x5a, 0x68, 0xef, 0x23, 0x64, 0xe0, 0x26, - 0xb1, 0xa4, 0x1e, 0x7e, 0x47, 0x8e, 0xcf, 0x03, 0x97, 0x0a, 0x98, 0x9b, 0x08, 0x60, 0x8b, 0x40, - 0x5e, 0x4a, 0xee, 0x88, 0xd4, 0x40, 0x7b, 0x1f, 0x23, 0x03, 0x5b, 0xc4, 0x4c, 0x3b, 0xa8, 0xf3, - 0x17, 0x80, 0xed, 0x99, 0xfb, 0xe6, 0xa5, 0x0c, 0xb4, 0xc3, 0x80, 0x86, 0xbf, 0x83, 0xf7, 0xef, - 0xb6, 0x7f, 0x03, 0xfd, 0x67, 0x53, 0x2f, 0x98, 0x85, 0xc7, 0x83, 0x13, 0xff, 0xf5, 0xed, 0xe7, - 0x33, 0xf7, 0x39, 0x0f, 0xa9, 0x27, 0x8b, 0x57, 0x21, 0xe3, 0xe2, 0xd2, 0xdb, 0x3c, 0x96, 0x4e, - 0x6e, 0x4d, 0xdd, 0xc5, 0xad, 0xa9, 0x7f, 0x8b, 0x87, 0xd7, 0x6d, 0xfe, 0xdf, 0xd3, 0x79, 0x38, - 0xf5, 0x16, 0x83, 0x67, 0xee, 0xaf, 0x47, 0xee, 0x9b, 0x21, 0xc3, 0x7f, 0x34, 0x1f, 0x4f, 0xf7, - 0x1e, 0x5f, 0x11, 0xef, 0xb1, 0x1b, 0x70, 0x30, 0x62, 0xcf, 0x04, 0x6c, 0x24, 0xf6, 0x1f, 0x00, - 0x3b, 0x9a, 0x12, 0xda, 0x43, 0x4c, 0xf1, 0xf0, 0x0f, 0x26, 0xe5, 0x2d, 0xe8, 0x8f, 0x3e, 0x9c, - 0x94, 0xd1, 0xdc, 0x3b, 0x71, 0xb9, 0x9e, 0xef, 0x3e, 0x90, 0x1e, 0x8e, 0x48, 0x5a, 0x8a, 0x28, - 0x7a, 0xaf, 0xf1, 0xfe, 0xdd, 0x76, 0xa5, 0x01, 0x3a, 0x60, 0xef, 0x6d, 0x0d, 0x5e, 0x97, 0x82, - 0xff, 0xfb, 0x85, 0xeb, 0x4f, 0xe2, 0xf4, 0xdf, 0xcf, 0x4b, 0xff, 0xa3, 0x35, 0x35, 0xff, 0x77, - 0xd5, 0x68, 0x5f, 0x67, 0xd1, 0x7e, 0xb4, 0xa6, 0x85, 0xbb, 0x92, 0xdc, 0x2c, 0xfd, 0xab, 0xac, - 0x45, 0xc9, 0x6e, 0x25, 0x98, 0x2b, 0x2c, 0x98, 0x45, 0x4b, 0x1a, 0x3e, 0x6a, 0xee, 0xb2, 0x07, - 0xc0, 0x66, 0x6c, 0xd4, 0xe4, 0x55, 0x43, 0xb5, 0xc6, 0x42, 0x35, 0x6e, 0x92, 0x90, 0x94, 0xc4, - 0x64, 0xcf, 0x40, 0x97, 0x35, 0xa9, 0x99, 0xa9, 0xc6, 0x61, 0x83, 0xc5, 0x61, 0xdc, 0x94, 0x46, - 0x8f, 0x96, 0x75, 0xec, 0x31, 0xa8, 0x1f, 0xad, 0x65, 0xd2, 0x4e, 0x8b, 0x31, 0xc8, 0x62, 0x2c, - 0x69, 0x4b, 0xa3, 0x42, 0x4f, 0x28, 0xf6, 0x26, 0xb4, 0x8f, 0xd6, 0xb2, 0x19, 0xa5, 0x47, 0x8f, - 0xc5, 0xa2, 0x27, 0x6d, 0x8c, 0x11, 0x77, 0x94, 0x4c, 0x61, 0x2f, 0x43, 0xe3, 0x68, 0x4d, 0x4e, - 0x95, 0x7d, 0x2d, 0x34, 0x5a, 0x2c, 0x34, 0xb8, 0x4a, 0x29, 0x36, 0x76, 0xd5, 0x44, 0x60, 0x0f, - 0x83, 0xc5, 0xcc, 0x91, 0x32, 0xe1, 0xef, 0x9c, 0x0b, 0xdf, 0xf9, 0x5f, 0x5c, 0x78, 0x76, 0x68, - 0xca, 0xed, 0x48, 0x2f, 0xc7, 0xb0, 0x0e, 0xab, 0x5c, 0xca, 0xde, 0x9f, 0x9f, 0xc0, 0xad, 0xcc, - 0x7a, 0xf4, 0x74, 0x7c, 0x4a, 0x9d, 0x39, 0xec, 0x8a, 0x03, 0x14, 0x57, 0xe5, 0xf5, 0xf8, 0xb4, - 0x07, 0x90, 0x81, 0xcd, 0x3b, 0xf7, 0x07, 0x79, 0xdb, 0xd7, 0x20, 0x17, 0x67, 0x30, 0xe2, 0x20, - 0x0f, 0x39, 0xc6, 0xd3, 0xf1, 0xe9, 0xb7, 0x8b, 0xe0, 0xec, 0x9c, 0xb4, 0xa9, 0x5a, 0x75, 0x3c, - 0xd8, 0x11, 0xd3, 0xa2, 0x3b, 0xc7, 0x86, 0x19, 0x7c, 0xd8, 0xd7, 0xab, 0x0f, 0x7b, 0xc4, 0x20, - 0x92, 0x59, 0x2d, 0xaa, 0x14, 0xa5, 0x51, 0xd1, 0x55, 0x61, 0xa3, 0xaa, 0x65, 0x47, 0x3d, 0x61, - 0x10, 0xfa, 0xa8, 0xb8, 0xc8, 0x46, 0x45, 0x33, 0xc4, 0x40, 0x36, 0xaa, 0xb6, 0xfa, 0x28, 0x8e, - 0x17, 0xcd, 0x4b, 0x47, 0x79, 0x4a, 0x51, 0x55, 0x75, 0x78, 0xc0, 0x47, 0xd5, 0xaf, 0xa0, 0xea, - 0xf0, 0x20, 0x47, 0x15, 0x2f, 0x0a, 0x55, 0x87, 0x07, 0xb2, 0xaa, 0x46, 0x29, 0x55, 0x87, 0x07, - 0x39, 0xaa, 0xa4, 0xa2, 0xf4, 0x11, 0x86, 0xa9, 0x59, 0xcd, 0xb2, 0x1f, 0xe1, 0x0b, 0x4f, 0x71, - 0x4b, 0x7c, 0x84, 0x49, 0x95, 0x4d, 0x0b, 0x33, 0x7e, 0xc1, 0xd5, 0xa7, 0xbd, 0xf0, 0x72, 0x0c, - 0x6b, 0x87, 0x9a, 0x63, 0xaa, 0x36, 0x61, 0x99, 0x79, 0x15, 0x6d, 0x92, 0x67, 0x92, 0xb6, 0xc8, - 0x34, 0xa1, 0x4d, 0x75, 0xcd, 0x2a, 0xa7, 0x2d, 0x63, 0x5b, 0x3b, 0xbc, 0xd0, 0x37, 0x9a, 0xfa, - 0x66, 0x97, 0xd5, 0x36, 0xca, 0xf5, 0x6d, 0x24, 0xfb, 0x46, 0x33, 0xbe, 0xb5, 0x4a, 0x4c, 0xcb, - 0xf5, 0x8d, 0x5e, 0xe8, 0x1b, 0x4d, 0x7d, 0x6b, 0x5f, 0x45, 0x5b, 0xd6, 0xb7, 0x91, 0xec, 0x1b, - 0xcd, 0xf8, 0xd6, 0x29, 0xa7, 0x2d, 0xeb, 0x1b, 0xd5, 0x7c, 0xf3, 0xa1, 0x13, 0xc7, 0xb0, 0x78, - 0xae, 0xd9, 0xb8, 0x2e, 0x1f, 0xf7, 0xa0, 0x44, 0x10, 0x47, 0x20, 0xc9, 0x3c, 0x11, 0x51, 0x69, - 0x99, 0x0d, 0x8c, 0x27, 0x49, 0xfa, 0x9c, 0xd5, 0x07, 0x0a, 0x4c, 0x4d, 0x60, 0x67, 0xa2, 0x95, - 0x75, 0x85, 0xc2, 0xbe, 0x8d, 0x2b, 0x29, 0x94, 0xfc, 0x93, 0x15, 0x46, 0x06, 0xc6, 0x0a, 0x55, - 0x07, 0x37, 0x4b, 0x2a, 0xcc, 0x58, 0xd8, 0x99, 0x68, 0x65, 0xe7, 0x0c, 0x6e, 0xc4, 0xdf, 0xa7, - 0x6c, 0xe2, 0x16, 0x9f, 0x38, 0x2c, 0xf1, 0x85, 0x4e, 0x34, 0x17, 0xc5, 0xe7, 0x2f, 0xd5, 0xf9, - 0xcc, 0x1c, 0x1f, 0xaf, 0x95, 0x98, 0x39, 0xc9, 0x35, 0xb2, 0x4b, 0x33, 0x4e, 0xea, 0x3a, 0x85, - 0x95, 0xd7, 0xaf, 0xa6, 0x53, 0xf2, 0x52, 0xd1, 0x19, 0x99, 0x99, 0xe8, 0x54, 0xdd, 0xec, 0x95, - 0xd5, 0x99, 0xb1, 0xb3, 0x4b, 0x33, 0x7e, 0x4e, 0xa0, 0x08, 0x85, 0x97, 0x7c, 0xe3, 0x65, 0xf3, - 0xb6, 0xf9, 0xbc, 0xaf, 0x56, 0xd7, 0x38, 0xf4, 0xfd, 0x79, 0x32, 0x4b, 0xfc, 0xca, 0x2c, 0x6a, - 0x6c, 0x0e, 0x1f, 0x20, 0xe9, 0xea, 0xaf, 0x3e, 0x87, 0xa1, 0x69, 0x9a, 0xec, 0x63, 0xb9, 0x26, - 0xe7, 0x67, 0x3a, 0xe9, 0x46, 0xe9, 0xfc, 0xd4, 0x13, 0x4d, 0xad, 0x4a, 0x7b, 0x51, 0xb4, 0xc1, - 0xb3, 0x61, 0x37, 0xcb, 0xee, 0x45, 0x7c, 0x97, 0xd6, 0xf7, 0xa2, 0xb8, 0xd8, 0x1f, 0xc2, 0xcd, - 0xbc, 0x65, 0xd7, 0xe9, 0x40, 0xe3, 0x67, 0xf7, 0x9c, 0xff, 0x92, 0xd9, 0x24, 0xec, 0x7f, 0x9d, - 0x4d, 0xb1, 0x7e, 0xf3, 0x5f, 0x2a, 0x01, 0x89, 0xfe, 0x71, 0x6f, 0xfd, 0x0b, 0xd0, 0x7f, 0x00, - 0x37, 0x72, 0x76, 0xd8, 0x22, 0x88, 0xf5, 0x5c, 0x08, 0x65, 0x37, 0x2d, 0x82, 0xa8, 0x6a, 0x10, - 0x39, 0x3b, 0xa7, 0x0c, 0x51, 0xcd, 0x81, 0x68, 0x5e, 0xc4, 0x22, 0xbd, 0x53, 0x45, 0x2c, 0x8c, - 0x2c, 0x0b, 0xfd, 0x8a, 0xc8, 0x10, 0x46, 0x11, 0x8b, 0xc4, 0x12, 0x75, 0xf5, 0x2b, 0xa2, 0x61, - 0x6b, 0x18, 0x79, 0x0b, 0x9d, 0x8c, 0x61, 0xaf, 0xc4, 0x63, 0xf9, 0xe3, 0xa8, 0xe4, 0xf0, 0xb8, - 0xec, 0x3c, 0x2a, 0x4b, 0xf3, 0x18, 0xad, 0x74, 0x1e, 0x5d, 0x1d, 0xa3, 0xe0, 0x3c, 0xba, 0x2b, - 0xf1, 0x58, 0xfe, 0x3c, 0x9c, 0x1c, 0x1e, 0x97, 0x9d, 0x87, 0x53, 0xc4, 0xe3, 0x1b, 0xb8, 0x95, - 0xbb, 0xa9, 0x14, 0x11, 0xa9, 0x6b, 0x20, 0xb9, 0xdb, 0x87, 0x0c, 0x52, 0x5f, 0x8d, 0xc9, 0xf2, - 0x47, 0x52, 0xcb, 0x63, 0x72, 0xd9, 0x99, 0xd4, 0x8a, 0x98, 0x3c, 0x84, 0xd7, 0xf2, 0x1f, 0xfe, - 0x22, 0x2a, 0x6d, 0x1d, 0x65, 0x52, 0x74, 0x2a, 0xed, 0x15, 0xb9, 0x2c, 0x7f, 0x2c, 0x9d, 0x5c, - 0x2e, 0x97, 0x9d, 0x4b, 0xa7, 0x88, 0xcb, 0x7d, 0xe8, 0x64, 0x1f, 0xd1, 0x22, 0x1e, 0x0d, 0x0d, - 0x21, 0xfb, 0x3c, 0xca, 0x08, 0x8d, 0xe5, 0xef, 0xcd, 0x85, 0x18, 0xcd, 0xa5, 0x93, 0x59, 0x79, - 0xcd, 0x8a, 0x20, 0x2c, 0x09, 0x42, 0xfa, 0x43, 0xd2, 0x97, 0x3f, 0x7d, 0x5e, 0xe2, 0xcf, 0x55, - 0xec, 0xa1, 0x3d, 0xae, 0xf1, 0x9f, 0xdc, 0xfd, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x05, 0x87, 0x7b, - 0x5f, 0xda, 0x1b, 0x00, 0x00, -} diff --git a/test/gogo/scalars_flags.pb.go b/test/gogo/scalars_flags.pb.go deleted file mode 100644 index 9c9495e..0000000 --- a/test/gogo/scalars_flags.pb.go +++ /dev/null @@ -1,1005 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.9.1 -// source: scalars.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - pflag "github.com/spf13/pflag" -) - -// AddSelectFlagsForMessageWithScalars adds flags to select fields in MessageWithScalars. -func AddSelectFlagsForMessageWithScalars(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("double-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("double-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("double-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("double-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("float-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("float-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("float-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("float-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bool-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bool-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bytes-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bytes-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("hex-bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("hex-bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("hex-bytes-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("hex-bytes-values", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithScalars message from select flags. -func PathsFromSelectFlagsForMessageWithScalars(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("double_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("double_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("double_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("double_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("float_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("float_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("float_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("float_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bool_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bytes_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bytes_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bytes_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("hex_bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("hex_bytes_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("hex_bytes_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("hex_bytes_values", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithScalars adds flags to select fields in MessageWithScalars. -func AddSetFlagsForMessageWithScalars(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewFloat64Flag(flagsplugin.Prefix("double-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat64SliceFlag(flagsplugin.Prefix("double-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32Flag(flagsplugin.Prefix("float-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32SliceFlag(flagsplugin.Prefix("float-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("int32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32SliceFlag(flagsplugin.Prefix("int32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("int64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64SliceFlag(flagsplugin.Prefix("int64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("uint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32SliceFlag(flagsplugin.Prefix("uint32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("uint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64SliceFlag(flagsplugin.Prefix("uint64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("sint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32SliceFlag(flagsplugin.Prefix("sint32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("sint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64SliceFlag(flagsplugin.Prefix("sint64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("fixed32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32SliceFlag(flagsplugin.Prefix("fixed32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("fixed64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64SliceFlag(flagsplugin.Prefix("fixed64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("sfixed32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32SliceFlag(flagsplugin.Prefix("sfixed32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("sfixed64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64SliceFlag(flagsplugin.Prefix("sfixed64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolSliceFlag(flagsplugin.Prefix("bool-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("string-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesSliceFlag(flagsplugin.Prefix("bytes-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewHexBytesFlag(flagsplugin.Prefix("hex-bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewHexBytesSliceFlag(flagsplugin.Prefix("hex-bytes-values", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithScalars message from flags. -func (m *MessageWithScalars) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetFloat64(flags, flagsplugin.Prefix("double_value", prefix)); err != nil { - return nil, err - } else if changed { - m.DoubleValue = val - paths = append(paths, flagsplugin.Prefix("double_value", prefix)) - } - if val, changed, err := flagsplugin.GetFloat64Slice(flags, flagsplugin.Prefix("double_values", prefix)); err != nil { - return nil, err - } else if changed { - m.DoubleValues = val - paths = append(paths, flagsplugin.Prefix("double_values", prefix)) - } - if val, changed, err := flagsplugin.GetFloat32(flags, flagsplugin.Prefix("float_value", prefix)); err != nil { - return nil, err - } else if changed { - m.FloatValue = val - paths = append(paths, flagsplugin.Prefix("float_value", prefix)) - } - if val, changed, err := flagsplugin.GetFloat32Slice(flags, flagsplugin.Prefix("float_values", prefix)); err != nil { - return nil, err - } else if changed { - m.FloatValues = val - paths = append(paths, flagsplugin.Prefix("float_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("int32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Int32Value = val - paths = append(paths, flagsplugin.Prefix("int32_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt32Slice(flags, flagsplugin.Prefix("int32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Int32Values = val - paths = append(paths, flagsplugin.Prefix("int32_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("int64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Int64Value = val - paths = append(paths, flagsplugin.Prefix("int64_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt64Slice(flags, flagsplugin.Prefix("int64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Int64Values = val - paths = append(paths, flagsplugin.Prefix("int64_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("uint32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint32Value = val - paths = append(paths, flagsplugin.Prefix("uint32_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint32Slice(flags, flagsplugin.Prefix("uint32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint32Values = val - paths = append(paths, flagsplugin.Prefix("uint32_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("uint64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint64Value = val - paths = append(paths, flagsplugin.Prefix("uint64_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint64Slice(flags, flagsplugin.Prefix("uint64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint64Values = val - paths = append(paths, flagsplugin.Prefix("uint64_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("sint32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Sint32Value = val - paths = append(paths, flagsplugin.Prefix("sint32_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt32Slice(flags, flagsplugin.Prefix("sint32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Sint32Values = val - paths = append(paths, flagsplugin.Prefix("sint32_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("sint64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Sint64Value = val - paths = append(paths, flagsplugin.Prefix("sint64_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt64Slice(flags, flagsplugin.Prefix("sint64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Sint64Values = val - paths = append(paths, flagsplugin.Prefix("sint64_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("fixed32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Fixed32Value = val - paths = append(paths, flagsplugin.Prefix("fixed32_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint32Slice(flags, flagsplugin.Prefix("fixed32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Fixed32Values = val - paths = append(paths, flagsplugin.Prefix("fixed32_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("fixed64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Fixed64Value = val - paths = append(paths, flagsplugin.Prefix("fixed64_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint64Slice(flags, flagsplugin.Prefix("fixed64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Fixed64Values = val - paths = append(paths, flagsplugin.Prefix("fixed64_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("sfixed32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Sfixed32Value = val - paths = append(paths, flagsplugin.Prefix("sfixed32_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt32Slice(flags, flagsplugin.Prefix("sfixed32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Sfixed32Values = val - paths = append(paths, flagsplugin.Prefix("sfixed32_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("sfixed64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Sfixed64Value = val - paths = append(paths, flagsplugin.Prefix("sfixed64_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt64Slice(flags, flagsplugin.Prefix("sfixed64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Sfixed64Values = val - paths = append(paths, flagsplugin.Prefix("sfixed64_values", prefix)) - } - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValue = val - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - if val, changed, err := flagsplugin.GetBoolSlice(flags, flagsplugin.Prefix("bool_values", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValues = val - paths = append(paths, flagsplugin.Prefix("bool_values", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValue = val - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("string_values", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValues = val - paths = append(paths, flagsplugin.Prefix("string_values", prefix)) - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BytesValue = val - paths = append(paths, flagsplugin.Prefix("bytes_value", prefix)) - } - if val, changed, err := flagsplugin.GetBytesSlice(flags, flagsplugin.Prefix("bytes_values", prefix)); err != nil { - return nil, err - } else if changed { - m.BytesValues = val - paths = append(paths, flagsplugin.Prefix("bytes_values", prefix)) - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("hex_bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - m.HexBytesValue = val - paths = append(paths, flagsplugin.Prefix("hex_bytes_value", prefix)) - } - if val, changed, err := flagsplugin.GetBytesSlice(flags, flagsplugin.Prefix("hex_bytes_values", prefix)); err != nil { - return nil, err - } else if changed { - m.HexBytesValues = val - paths = append(paths, flagsplugin.Prefix("hex_bytes_values", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithOneofScalars adds flags to select fields in MessageWithOneofScalars. -func AddSelectFlagsForMessageWithOneofScalars(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.double-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.double-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.float-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.float-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.int32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.int32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.int64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.int64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.uint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.uint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.uint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.uint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.sint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.sint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.sint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.sint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.fixed32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.fixed32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.fixed64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.fixed64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.sfixed32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.sfixed32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.sfixed64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.sfixed64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bool-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.bool-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.hex-bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.hex-bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithOneofScalars message from select flags. -func PathsFromSelectFlagsForMessageWithOneofScalars(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.double_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.double_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.float_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.float_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.int32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.int32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.int64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.int64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.uint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.uint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.uint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.uint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.sint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.sint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.sint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.sint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.fixed32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.fixed32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.fixed64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.fixed64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.sfixed32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.sfixed32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.sfixed64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.sfixed64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bool_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.bool_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.bytes_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.hex_bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.hex_bytes_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithOneofScalars adds flags to select fields in MessageWithOneofScalars. -func AddSetFlagsForMessageWithOneofScalars(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewFloat64Flag(flagsplugin.Prefix("value.double-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32Flag(flagsplugin.Prefix("value.float-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("value.int32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("value.int64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("value.uint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("value.uint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("value.sint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("value.sint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("value.fixed32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("value.fixed64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("value.sfixed32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("value.sfixed64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bool-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("value.string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("value.bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewHexBytesFlag(flagsplugin.Prefix("value.hex-bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithOneofScalars message from flags. -func (m *MessageWithOneofScalars) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetFloat64(flags, flagsplugin.Prefix("value.double_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_DoubleValue{} - ov.DoubleValue = val - paths = append(paths, flagsplugin.Prefix("value.double_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetFloat32(flags, flagsplugin.Prefix("value.float_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_FloatValue{} - ov.FloatValue = val - paths = append(paths, flagsplugin.Prefix("value.float_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("value.int32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Int32Value{} - ov.Int32Value = val - paths = append(paths, flagsplugin.Prefix("value.int32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("value.int64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Int64Value{} - ov.Int64Value = val - paths = append(paths, flagsplugin.Prefix("value.int64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("value.uint32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Uint32Value{} - ov.Uint32Value = val - paths = append(paths, flagsplugin.Prefix("value.uint32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("value.uint64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Uint64Value{} - ov.Uint64Value = val - paths = append(paths, flagsplugin.Prefix("value.uint64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("value.sint32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Sint32Value{} - ov.Sint32Value = val - paths = append(paths, flagsplugin.Prefix("value.sint32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("value.sint64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Sint64Value{} - ov.Sint64Value = val - paths = append(paths, flagsplugin.Prefix("value.sint64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("value.fixed32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Fixed32Value{} - ov.Fixed32Value = val - paths = append(paths, flagsplugin.Prefix("value.fixed32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("value.fixed64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Fixed64Value{} - ov.Fixed64Value = val - paths = append(paths, flagsplugin.Prefix("value.fixed64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("value.sfixed32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Sfixed32Value{} - ov.Sfixed32Value = val - paths = append(paths, flagsplugin.Prefix("value.sfixed32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("value.sfixed64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_Sfixed64Value{} - ov.Sfixed64Value = val - paths = append(paths, flagsplugin.Prefix("value.sfixed64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bool_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_BoolValue{} - ov.BoolValue = val - paths = append(paths, flagsplugin.Prefix("value.bool_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("value.string_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_StringValue{} - ov.StringValue = val - paths = append(paths, flagsplugin.Prefix("value.string_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("value.bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_BytesValue{} - ov.BytesValue = val - paths = append(paths, flagsplugin.Prefix("value.bytes_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("value.hex_bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofScalars_HexBytesValue{} - ov.HexBytesValue = val - paths = append(paths, flagsplugin.Prefix("value.hex_bytes_value", prefix)) - m.Value = ov - } - return paths, nil -} - -// AddSelectFlagsForMessageWithScalarMaps adds flags to select fields in MessageWithScalarMaps. -func AddSelectFlagsForMessageWithScalarMaps(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-double-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-double-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-float-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-float-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-int32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-int32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int32-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int32-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-int64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-int64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int64-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int64-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-uint32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-uint32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint32-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint32-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-uint64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-uint64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint64-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint64-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-sint32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-sint32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint32-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint32-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-sint64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-sint64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sint64-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sint64-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-fixed32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-fixed32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed32-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed32-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-fixed64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-fixed64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("fixed64-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("fixed64-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-sfixed32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-sfixed32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed32-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed32-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-sfixed64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-sfixed64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sfixed64-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sfixed64-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-bool-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-bool-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bool-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-bytes-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-bytes-map", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithScalarMaps message from select flags. -func PathsFromSelectFlagsForMessageWithScalarMaps(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_double_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_double_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_float_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_float_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_int32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_int32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int32_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int32_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_int64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_int64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int64_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int64_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_uint32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_uint32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint32_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint32_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_uint64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_uint64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint64_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint64_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_sint32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_sint32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint32_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint32_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_sint64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_sint64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sint64_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sint64_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_fixed32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_fixed32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed32_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed32_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_fixed64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_fixed64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("fixed64_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("fixed64_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_sfixed32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_sfixed32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed32_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed32_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_sfixed64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_sfixed64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sfixed64_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sfixed64_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_bool_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_bool_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bool_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_bytes_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_bytes_map", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithScalarMaps adds flags to select fields in MessageWithScalarMaps. -func AddSetFlagsForMessageWithScalarMaps(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFloat64MapFlag(flagsplugin.Prefix("string-double-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFloat32MapFlag(flagsplugin.Prefix("string-float-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringInt32MapFlag(flagsplugin.Prefix("string-int32-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Int32StringMap because maps with int32 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringInt64MapFlag(flagsplugin.Prefix("string-int64-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Int64StringMap because maps with int64 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringUint32MapFlag(flagsplugin.Prefix("string-uint32-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Uint32StringMap because maps with uint32 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringUint64MapFlag(flagsplugin.Prefix("string-uint64-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Uint64StringMap because maps with uint64 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringInt32MapFlag(flagsplugin.Prefix("string-sint32-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Sint32StringMap because maps with sint32 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringInt64MapFlag(flagsplugin.Prefix("string-sint64-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Sint64StringMap because maps with sint64 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringUint32MapFlag(flagsplugin.Prefix("string-fixed32-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Fixed32StringMap because maps with fixed32 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringUint64MapFlag(flagsplugin.Prefix("string-fixed64-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Fixed64StringMap because maps with fixed64 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringInt32MapFlag(flagsplugin.Prefix("string-sfixed32-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Sfixed32StringMap because maps with sfixed32 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringInt64MapFlag(flagsplugin.Prefix("string-sfixed64-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping Sfixed64StringMap because maps with sfixed64 key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringBoolMapFlag(flagsplugin.Prefix("string-bool-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping BoolStringMap because maps with bool key types are currently not supported. - flags.AddFlag(flagsplugin.NewStringStringMapFlag(flagsplugin.Prefix("string-string-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringBytesMapFlag(flagsplugin.Prefix("string-bytes-map", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithScalarMaps message from flags. -func (m *MessageWithScalarMaps) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetStringFloat64Map(flags, flagsplugin.Prefix("string_double_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringDoubleMap = val - paths = append(paths, flagsplugin.Prefix("string_double_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringFloat32Map(flags, flagsplugin.Prefix("string_float_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringFloatMap = val - paths = append(paths, flagsplugin.Prefix("string_float_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringInt32Map(flags, flagsplugin.Prefix("string_int32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringInt32Map = val - paths = append(paths, flagsplugin.Prefix("string_int32_map", prefix)) - } - // FIXME: Skipping Int32StringMap because maps with int32 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringInt64Map(flags, flagsplugin.Prefix("string_int64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringInt64Map = val - paths = append(paths, flagsplugin.Prefix("string_int64_map", prefix)) - } - // FIXME: Skipping Int64StringMap because maps with int64 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringUint32Map(flags, flagsplugin.Prefix("string_uint32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringUint32Map = val - paths = append(paths, flagsplugin.Prefix("string_uint32_map", prefix)) - } - // FIXME: Skipping Uint32StringMap because maps with uint32 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringUint64Map(flags, flagsplugin.Prefix("string_uint64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringUint64Map = val - paths = append(paths, flagsplugin.Prefix("string_uint64_map", prefix)) - } - // FIXME: Skipping Uint64StringMap because maps with uint64 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringInt32Map(flags, flagsplugin.Prefix("string_sint32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringSint32Map = val - paths = append(paths, flagsplugin.Prefix("string_sint32_map", prefix)) - } - // FIXME: Skipping Sint32StringMap because maps with sint32 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringInt64Map(flags, flagsplugin.Prefix("string_sint64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringSint64Map = val - paths = append(paths, flagsplugin.Prefix("string_sint64_map", prefix)) - } - // FIXME: Skipping Sint64StringMap because maps with sint64 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringUint32Map(flags, flagsplugin.Prefix("string_fixed32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringFixed32Map = val - paths = append(paths, flagsplugin.Prefix("string_fixed32_map", prefix)) - } - // FIXME: Skipping Fixed32StringMap because maps with fixed32 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringUint64Map(flags, flagsplugin.Prefix("string_fixed64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringFixed64Map = val - paths = append(paths, flagsplugin.Prefix("string_fixed64_map", prefix)) - } - // FIXME: Skipping Fixed64StringMap because maps with fixed64 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringInt32Map(flags, flagsplugin.Prefix("string_sfixed32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringSfixed32Map = val - paths = append(paths, flagsplugin.Prefix("string_sfixed32_map", prefix)) - } - // FIXME: Skipping Sfixed32StringMap because maps with sfixed32 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringInt64Map(flags, flagsplugin.Prefix("string_sfixed64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringSfixed64Map = val - paths = append(paths, flagsplugin.Prefix("string_sfixed64_map", prefix)) - } - // FIXME: Skipping Sfixed64StringMap because maps with sfixed64 key types are currently not supported. - if val, changed, err := flagsplugin.GetStringBoolMap(flags, flagsplugin.Prefix("string_bool_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringBoolMap = val - paths = append(paths, flagsplugin.Prefix("string_bool_map", prefix)) - } - // FIXME: Skipping BoolStringMap because maps with bool key types are currently not supported. - if val, changed, err := flagsplugin.GetStringStringMap(flags, flagsplugin.Prefix("string_string_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringStringMap = val - paths = append(paths, flagsplugin.Prefix("string_string_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringBytesMap(flags, flagsplugin.Prefix("string_bytes_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringBytesMap = val - paths = append(paths, flagsplugin.Prefix("string_bytes_map", prefix)) - } - return paths, nil -} diff --git a/test/gogo/scalars_test.go b/test/gogo/scalars_test.go deleted file mode 100644 index 7e19c0d..0000000 --- a/test/gogo/scalars_test.go +++ /dev/null @@ -1,310 +0,0 @@ -package test_test - -import ( - "encoding/base64" - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/gogo" - pflag "github.com/spf13/pflag" -) - -var testMessagesWithScalars = []struct { - name string - arguments []string - expectedMessage MessageWithScalars - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithScalars{}, - expectedMask: nil, - }, - { - name: "full", - arguments: []string{ - "--double-value", "2.0", - "--double-values", "1.0,2.0,3", - "--float-value", "1.32432", - "--float-values", "1.213213,3.34214312", - "--int32-value", "43214123", - "--int32-values", "848348348,237148293", - "--int64-value", "73458975481", - "--int64-values", "9321894,4632112387634,6747823", - "--uint32-value", "213123", - "--uint32-values", "213123,7342859", - "--uint64-value", "213123", - "--uint64-values", "213123,7342859", - "--sint32-value", "213123", - "--sint32-values", "213123,7342859", - "--sint64-value", "213123", - "--sint64-values", "213123,7342859", - "--fixed32-value", "213123", - "--fixed32-values", "213123,7342859", - "--fixed64-value", "213123", - "--fixed64-values", "213123,7342859", - "--sfixed32-value", "213123", - "--sfixed32-values", "213123,7342859", - "--sfixed64-value", "213123", - "--sfixed64-values", "213123,7342859", - "--bool-value", - "--bool-values", "true,false", - "--string-value", "string1", - "--string-values", "string1,string2,string3", - "--bytes-value", "AQIDBAUGBwg=", - "--bytes-values", "AQIDBAUGBwg=,AQIDBAUGBwg=,AQIDBAUGBwg=", - "--hex-bytes-value", "01020304", - "--hex-bytes-values", "01020304", - "--hex-bytes-values", "0102030405,010203040506", - }, - expectedMessage: MessageWithScalars{ - DoubleValue: 2.0, - DoubleValues: []float64{1.0, 2.0, 3.0}, - FloatValue: 1.32432, - FloatValues: []float32{1.213213, 3.34214312}, - Int32Value: 43214123, - Int32Values: []int32{848348348, 237148293}, - Int64Value: 73458975481, - Int64Values: []int64{9321894, 4632112387634, 6747823}, - Uint32Value: 213123, - Uint32Values: []uint32{213123, 7342859}, - Uint64Value: 213123, - Uint64Values: []uint64{213123, 7342859}, - Sint32Value: 213123, - Sint32Values: []int32{213123, 7342859}, - Sint64Value: 213123, - Sint64Values: []int64{213123, 7342859}, - Fixed32Value: 213123, - Fixed32Values: []uint32{213123, 7342859}, - Fixed64Value: 213123, - Fixed64Values: []uint64{213123, 7342859}, - Sfixed32Value: 213123, - Sfixed32Values: []int32{213123, 7342859}, - Sfixed64Value: 213123, - Sfixed64Values: []int64{213123, 7342859}, - BoolValue: true, - BoolValues: []bool{true, false}, - StringValue: "string1", - StringValues: []string{"string1", "string2", "string3"}, - BytesValue: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - BytesValues: [][]byte{{1, 2, 3, 4, 5, 6, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}, {1, 2, 3, 4, 5, 6, 7, 8}}, - HexBytesValue: []byte{1, 2, 3, 4}, - HexBytesValues: [][]byte{{1, 2, 3, 4}, {1, 2, 3, 4, 5}, {1, 2, 3, 4, 5, 6}}, - }, - expectedMask: []string{ - "double_value", - "double_values", - "float_value", - "float_values", - "int32_value", - "int32_values", - "int64_value", - "int64_values", - "uint32_value", - "uint32_values", - "uint64_value", - "uint64_values", - "sint32_value", - "sint32_values", - "sint64_value", - "sint64_values", - "fixed32_value", - "fixed32_values", - "fixed64_value", - "fixed64_values", - "sfixed32_value", - "sfixed32_values", - "sfixed64_value", - "sfixed64_values", - "bool_value", - "bool_values", - "string_value", - "string_values", - "bytes_value", - "bytes_values", - "hex_bytes_value", - "hex_bytes_values", - }, - }, -} - -var testMessagesWithOneofScalars = []struct { - name string - arguments []string - expectedMessage MessageWithOneofScalars - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithOneofScalars{}, - expectedMask: nil, - }, - { - name: "one value set", - arguments: []string{ - "--value.sint32-value", "-213123", - }, - expectedMessage: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_Sint32Value{ - Sint32Value: -213123, - }, - }, - expectedMask: []string{ - "value.sint32_value", - }, - }, - { - name: "all values set, last value overwrites others", - arguments: []string{ - "--value.double-value", "2.0", - "--value.float-value", "1.32432", - "--value.int32-value", "43214123", - "--value.int64-value", "73458975481", - "--value.uint32-value", "213123", - "--value.uint64-value", "213123", - "--value.sint32-value", "213123", - "--value.sint64-value", "213123", - "--value.fixed32-value", "213123", - "--value.fixed64-value", "213123", - "--value.sfixed32-value", "213123", - "--value.sfixed64-value", "213123", - "--value.bool-value", - "--value.string-value", "string1", - "--value.bytes-value", "AQIDBAUGBwg=", - }, - expectedMessage: MessageWithOneofScalars{ - Value: &MessageWithOneofScalars_BytesValue{ - BytesValue: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - }, - }, - expectedMask: []string{ - "value.double_value", - "value.float_value", - "value.int32_value", - "value.int64_value", - "value.uint32_value", - "value.uint64_value", - "value.sint32_value", - "value.sint64_value", - "value.fixed32_value", - "value.fixed64_value", - "value.sfixed32_value", - "value.sfixed64_value", - "value.bool_value", - "value.string_value", - "value.bytes_value", - }, - }, -} - -var testMessagesWithScalarMaps = []struct { - name string - arguments []string - expectedMessage MessageWithScalarMaps - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithScalarMaps{}, - expectedMask: nil, - }, - { - name: "full", - arguments: []string{ - "--string-double-map", "foo=12.34,bar=23.21", - "--string-double-map", "baz=10.11", - "--string-float-map", "foo=10.3221534", - "--string-int32-map", "bar=-234", - "--string-int64-map", "foo=10,bar=12", - "--string-uint32-map", "foo=10,bar=12", - "--string-uint64-map", "foo=10,bar=12", - "--string-sint32-map", "foo=10,bar=12", - "--string-sint64-map", "foo=10,bar=12", - "--string-fixed32-map", "foo=10,bar=12", - "--string-fixed64-map", "foo=10,bar=12", - "--string-sfixed32-map", "foo=10,bar=12", - "--string-sfixed64-map", "foo=10,bar=12", - "--string-bool-map", "foo=true,bar=false", - "--string-string-map", "foo=bar,bar=baz", - "--string-bytes-map", "foo=AQIDBAUGBwg=,bar=AQIDBAUGBwg=", - }, - expectedMessage: MessageWithScalarMaps{ - StringDoubleMap: map[string]float64{ - "foo": 12.34, "bar": 23.21, "baz": 10.11, - }, - StringFloatMap: map[string]float32{"foo": 10.3221534}, - StringInt32Map: map[string]int32{"bar": -234}, - StringInt64Map: map[string]int64{"foo": 10, "bar": 12}, - StringUint32Map: map[string]uint32{"foo": 10, "bar": 12}, - StringUint64Map: map[string]uint64{"foo": 10, "bar": 12}, - StringSint32Map: map[string]int32{"foo": 10, "bar": 12}, - StringSint64Map: map[string]int64{"foo": 10, "bar": 12}, - StringFixed32Map: map[string]uint32{"foo": 10, "bar": 12}, - StringFixed64Map: map[string]uint64{"foo": 10, "bar": 12}, - StringSfixed32Map: map[string]int32{"foo": 10, "bar": 12}, - StringSfixed64Map: map[string]int64{"foo": 10, "bar": 12}, - StringBoolMap: map[string]bool{"foo": true, "bar": false}, - StringStringMap: map[string]string{"foo": "bar", "bar": "baz"}, - StringBytesMap: map[string][]byte{ - "foo": {1, 2, 3, 4, 5, 6, 7, 8}, "bar": {1, 2, 3, 4, 5, 6, 7, 8}, - }, - }, - expectedMask: []string{ - "string_double_map", - "string_float_map", - "string_int32_map", - "string_int64_map", - "string_uint32_map", - "string_uint64_map", - "string_sint32_map", - "string_sint64_map", - "string_fixed32_map", - "string_fixed64_map", - "string_sfixed32_map", - "string_sfixed64_map", - "string_bool_map", - "string_string_map", - "string_bytes_map", - }, - }, -} - -func getBytesValue(s string) []byte { - val, err := base64.RawStdEncoding.DecodeString(s) - if err != nil { - panic(err) - } - return val -} - -func TestSetFlagsMessageWithScalars(t *testing.T) { - for _, tt := range testMessagesWithScalars { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithScalars(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithOneofScalars(t *testing.T) { - for _, tt := range testMessagesWithOneofScalars { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithOneofScalars(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithScalarMaps(t *testing.T) { - for _, tt := range testMessagesWithScalarMaps { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithScalarMaps(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/gogo/utils_test.go b/test/gogo/utils_test.go deleted file mode 100644 index 7dd372a..0000000 --- a/test/gogo/utils_test.go +++ /dev/null @@ -1,54 +0,0 @@ -package test_test - -import ( - "reflect" - "testing" - - "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - proto "github.com/gogo/protobuf/proto" - "github.com/google/go-cmp/cmp" - pflag "github.com/spf13/pflag" -) - -func setFromFlags(t *testing.T, msg proto.Message, flagSet *pflag.FlagSet) []string { - t.Helper() - - message, ok := msg.(flagsplugin.SetterFromFlags) - if !ok { - t.Fatalf("message %T does not implement the flagsplugin.SetFromFlags", msg) - } - paths, err := message.SetFromFlags(flagSet, "") - if err != nil { - t.Fatalf("unexpected error from SetFromFlags for %T: %v", msg, err) - } - return paths -} - -func expectMessageEqual(t *testing.T, flagSet *pflag.FlagSet, arguments []string, expectedMessage proto.Message, expectedMask []string) { - t.Helper() - if expectedMessage == nil { - return - } - expectedMsgText := proto.MarshalTextString(expectedMessage) - generatedMessage := reflect.New(reflect.ValueOf(expectedMessage).Elem().Type()).Interface().(proto.Message) - - flagSet.Parse(arguments) - mask := setFromFlags(t, generatedMessage, flagSet) - generatedMsgText := proto.MarshalTextString(generatedMessage) - - generatedDiff := cmp.Diff(expectedMsgText, generatedMsgText) - maskDiff := cmp.Diff(expectedMask, mask) - - if generatedDiff != "" { - t.Errorf("expected : %s", string(expectedMsgText)) - // t.Errorf("gogo : %s", string(gogoMsgText)) - t.Errorf("generated: %s", string(generatedMsgText)) - if generatedDiff != "" { - t.Errorf(" diff : %s", generatedDiff) - } - } - - if maskDiff != "" { - t.Errorf("mask diff: %s", maskDiff) - } -} diff --git a/test/gogo/wkts.pb.go b/test/gogo/wkts.pb.go deleted file mode 100644 index a9cc3c6..0000000 --- a/test/gogo/wkts.pb.go +++ /dev/null @@ -1,893 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wkts.proto - -package test - -import ( - fmt "fmt" - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - math "math" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MessageWithWKTs struct { - DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3" json:"double_value,omitempty"` - DoubleValues []*types.DoubleValue `protobuf:"bytes,2,rep,name=double_values,json=doubleValues,proto3" json:"double_values,omitempty"` - FloatValue *types.FloatValue `protobuf:"bytes,3,opt,name=float_value,json=floatValue,proto3" json:"float_value,omitempty"` - FloatValues []*types.FloatValue `protobuf:"bytes,4,rep,name=float_values,json=floatValues,proto3" json:"float_values,omitempty"` - Int32Value *types.Int32Value `protobuf:"bytes,5,opt,name=int32_value,json=int32Value,proto3" json:"int32_value,omitempty"` - Int32Values []*types.Int32Value `protobuf:"bytes,6,rep,name=int32_values,json=int32Values,proto3" json:"int32_values,omitempty"` - Int64Value *types.Int64Value `protobuf:"bytes,7,opt,name=int64_value,json=int64Value,proto3" json:"int64_value,omitempty"` - Int64Values []*types.Int64Value `protobuf:"bytes,8,rep,name=int64_values,json=int64Values,proto3" json:"int64_values,omitempty"` - Uint32Value *types.UInt32Value `protobuf:"bytes,9,opt,name=uint32_value,json=uint32Value,proto3" json:"uint32_value,omitempty"` - Uint32Values []*types.UInt32Value `protobuf:"bytes,10,rep,name=uint32_values,json=uint32Values,proto3" json:"uint32_values,omitempty"` - Uint64Value *types.UInt64Value `protobuf:"bytes,11,opt,name=uint64_value,json=uint64Value,proto3" json:"uint64_value,omitempty"` - Uint64Values []*types.UInt64Value `protobuf:"bytes,12,rep,name=uint64_values,json=uint64Values,proto3" json:"uint64_values,omitempty"` - BoolValue *types.BoolValue `protobuf:"bytes,13,opt,name=bool_value,json=boolValue,proto3" json:"bool_value,omitempty"` - BoolValues []*types.BoolValue `protobuf:"bytes,14,rep,name=bool_values,json=boolValues,proto3" json:"bool_values,omitempty"` - StringValue *types.StringValue `protobuf:"bytes,15,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - StringValues []*types.StringValue `protobuf:"bytes,16,rep,name=string_values,json=stringValues,proto3" json:"string_values,omitempty"` - BytesValue *types.BytesValue `protobuf:"bytes,17,opt,name=bytes_value,json=bytesValue,proto3" json:"bytes_value,omitempty"` - BytesValues []*types.BytesValue `protobuf:"bytes,18,rep,name=bytes_values,json=bytesValues,proto3" json:"bytes_values,omitempty"` - EmptyValue *types.Empty `protobuf:"bytes,19,opt,name=empty_value,json=emptyValue,proto3" json:"empty_value,omitempty"` - EmptyValues []*types.Empty `protobuf:"bytes,20,rep,name=empty_values,json=emptyValues,proto3" json:"empty_values,omitempty"` - TimestampValue *types.Timestamp `protobuf:"bytes,21,opt,name=timestamp_value,json=timestampValue,proto3" json:"timestamp_value,omitempty"` - TimestampValues []*types.Timestamp `protobuf:"bytes,22,rep,name=timestamp_values,json=timestampValues,proto3" json:"timestamp_values,omitempty"` - DurationValue *types.Duration `protobuf:"bytes,23,opt,name=duration_value,json=durationValue,proto3" json:"duration_value,omitempty"` - DurationValues []*types.Duration `protobuf:"bytes,24,rep,name=duration_values,json=durationValues,proto3" json:"duration_values,omitempty"` - FieldMaskValue *types.FieldMask `protobuf:"bytes,25,opt,name=field_mask_value,json=fieldMaskValue,proto3" json:"field_mask_value,omitempty"` - FieldMaskValues []*types.FieldMask `protobuf:"bytes,26,rep,name=field_mask_values,json=fieldMaskValues,proto3" json:"field_mask_values,omitempty"` - ValueValue *types.Value `protobuf:"bytes,27,opt,name=value_value,json=valueValue,proto3" json:"value_value,omitempty"` - ValueValues []*types.Value `protobuf:"bytes,28,rep,name=value_values,json=valueValues,proto3" json:"value_values,omitempty"` - ListValueValue *types.ListValue `protobuf:"bytes,29,opt,name=list_value_value,json=listValueValue,proto3" json:"list_value_value,omitempty"` - ListValueValues []*types.ListValue `protobuf:"bytes,30,rep,name=list_value_values,json=listValueValues,proto3" json:"list_value_values,omitempty"` - StructValue *types.Struct `protobuf:"bytes,31,opt,name=struct_value,json=structValue,proto3" json:"struct_value,omitempty"` - StructValues []*types.Struct `protobuf:"bytes,32,rep,name=struct_values,json=structValues,proto3" json:"struct_values,omitempty"` - AnyValue *types.Any `protobuf:"bytes,33,opt,name=any_value,json=anyValue,proto3" json:"any_value,omitempty"` - AnyValues []*types.Any `protobuf:"bytes,34,rep,name=any_values,json=anyValues,proto3" json:"any_values,omitempty"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithWKTs) Reset() { *m = MessageWithWKTs{} } -func (m *MessageWithWKTs) String() string { return proto.CompactTextString(m) } -func (*MessageWithWKTs) ProtoMessage() {} -func (*MessageWithWKTs) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{0} -} -func (m *MessageWithWKTs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithWKTs.Unmarshal(m, b) -} -func (m *MessageWithWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithWKTs.Marshal(b, m, deterministic) -} -func (m *MessageWithWKTs) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithWKTs.Merge(m, src) -} -func (m *MessageWithWKTs) XXX_Size() int { - return xxx_messageInfo_MessageWithWKTs.Size(m) -} -func (m *MessageWithWKTs) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithWKTs.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithWKTs proto.InternalMessageInfo - -func (m *MessageWithWKTs) GetDoubleValue() *types.DoubleValue { - if m != nil { - return m.DoubleValue - } - return nil -} - -func (m *MessageWithWKTs) GetDoubleValues() []*types.DoubleValue { - if m != nil { - return m.DoubleValues - } - return nil -} - -func (m *MessageWithWKTs) GetFloatValue() *types.FloatValue { - if m != nil { - return m.FloatValue - } - return nil -} - -func (m *MessageWithWKTs) GetFloatValues() []*types.FloatValue { - if m != nil { - return m.FloatValues - } - return nil -} - -func (m *MessageWithWKTs) GetInt32Value() *types.Int32Value { - if m != nil { - return m.Int32Value - } - return nil -} - -func (m *MessageWithWKTs) GetInt32Values() []*types.Int32Value { - if m != nil { - return m.Int32Values - } - return nil -} - -func (m *MessageWithWKTs) GetInt64Value() *types.Int64Value { - if m != nil { - return m.Int64Value - } - return nil -} - -func (m *MessageWithWKTs) GetInt64Values() []*types.Int64Value { - if m != nil { - return m.Int64Values - } - return nil -} - -func (m *MessageWithWKTs) GetUint32Value() *types.UInt32Value { - if m != nil { - return m.Uint32Value - } - return nil -} - -func (m *MessageWithWKTs) GetUint32Values() []*types.UInt32Value { - if m != nil { - return m.Uint32Values - } - return nil -} - -func (m *MessageWithWKTs) GetUint64Value() *types.UInt64Value { - if m != nil { - return m.Uint64Value - } - return nil -} - -func (m *MessageWithWKTs) GetUint64Values() []*types.UInt64Value { - if m != nil { - return m.Uint64Values - } - return nil -} - -func (m *MessageWithWKTs) GetBoolValue() *types.BoolValue { - if m != nil { - return m.BoolValue - } - return nil -} - -func (m *MessageWithWKTs) GetBoolValues() []*types.BoolValue { - if m != nil { - return m.BoolValues - } - return nil -} - -func (m *MessageWithWKTs) GetStringValue() *types.StringValue { - if m != nil { - return m.StringValue - } - return nil -} - -func (m *MessageWithWKTs) GetStringValues() []*types.StringValue { - if m != nil { - return m.StringValues - } - return nil -} - -func (m *MessageWithWKTs) GetBytesValue() *types.BytesValue { - if m != nil { - return m.BytesValue - } - return nil -} - -func (m *MessageWithWKTs) GetBytesValues() []*types.BytesValue { - if m != nil { - return m.BytesValues - } - return nil -} - -func (m *MessageWithWKTs) GetEmptyValue() *types.Empty { - if m != nil { - return m.EmptyValue - } - return nil -} - -func (m *MessageWithWKTs) GetEmptyValues() []*types.Empty { - if m != nil { - return m.EmptyValues - } - return nil -} - -func (m *MessageWithWKTs) GetTimestampValue() *types.Timestamp { - if m != nil { - return m.TimestampValue - } - return nil -} - -func (m *MessageWithWKTs) GetTimestampValues() []*types.Timestamp { - if m != nil { - return m.TimestampValues - } - return nil -} - -func (m *MessageWithWKTs) GetDurationValue() *types.Duration { - if m != nil { - return m.DurationValue - } - return nil -} - -func (m *MessageWithWKTs) GetDurationValues() []*types.Duration { - if m != nil { - return m.DurationValues - } - return nil -} - -func (m *MessageWithWKTs) GetFieldMaskValue() *types.FieldMask { - if m != nil { - return m.FieldMaskValue - } - return nil -} - -func (m *MessageWithWKTs) GetFieldMaskValues() []*types.FieldMask { - if m != nil { - return m.FieldMaskValues - } - return nil -} - -func (m *MessageWithWKTs) GetValueValue() *types.Value { - if m != nil { - return m.ValueValue - } - return nil -} - -func (m *MessageWithWKTs) GetValueValues() []*types.Value { - if m != nil { - return m.ValueValues - } - return nil -} - -func (m *MessageWithWKTs) GetListValueValue() *types.ListValue { - if m != nil { - return m.ListValueValue - } - return nil -} - -func (m *MessageWithWKTs) GetListValueValues() []*types.ListValue { - if m != nil { - return m.ListValueValues - } - return nil -} - -func (m *MessageWithWKTs) GetStructValue() *types.Struct { - if m != nil { - return m.StructValue - } - return nil -} - -func (m *MessageWithWKTs) GetStructValues() []*types.Struct { - if m != nil { - return m.StructValues - } - return nil -} - -func (m *MessageWithWKTs) GetAnyValue() *types.Any { - if m != nil { - return m.AnyValue - } - return nil -} - -func (m *MessageWithWKTs) GetAnyValues() []*types.Any { - if m != nil { - return m.AnyValues - } - return nil -} - -type MessageWithOneofWKTs struct { - // Types that are valid to be assigned to Value: - // - // *MessageWithOneofWKTs_DoubleValue - // *MessageWithOneofWKTs_FloatValue - // *MessageWithOneofWKTs_Int32Value - // *MessageWithOneofWKTs_Int64Value - // *MessageWithOneofWKTs_Uint32Value - // *MessageWithOneofWKTs_Uint64Value - // *MessageWithOneofWKTs_BoolValue - // *MessageWithOneofWKTs_StringValue - // *MessageWithOneofWKTs_BytesValue - // *MessageWithOneofWKTs_EmptyValue - // *MessageWithOneofWKTs_TimestampValue - // *MessageWithOneofWKTs_DurationValue - // *MessageWithOneofWKTs_FieldMaskValue - // *MessageWithOneofWKTs_ValueValue - // *MessageWithOneofWKTs_ListValueValue - // *MessageWithOneofWKTs_StructValue - // *MessageWithOneofWKTs_AnyValue - Value isMessageWithOneofWKTs_Value `protobuf_oneof:"value"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithOneofWKTs) Reset() { *m = MessageWithOneofWKTs{} } -func (m *MessageWithOneofWKTs) String() string { return proto.CompactTextString(m) } -func (*MessageWithOneofWKTs) ProtoMessage() {} -func (*MessageWithOneofWKTs) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{1} -} -func (m *MessageWithOneofWKTs) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithOneofWKTs.Unmarshal(m, b) -} -func (m *MessageWithOneofWKTs) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithOneofWKTs.Marshal(b, m, deterministic) -} -func (m *MessageWithOneofWKTs) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithOneofWKTs.Merge(m, src) -} -func (m *MessageWithOneofWKTs) XXX_Size() int { - return xxx_messageInfo_MessageWithOneofWKTs.Size(m) -} -func (m *MessageWithOneofWKTs) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithOneofWKTs.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithOneofWKTs proto.InternalMessageInfo - -type isMessageWithOneofWKTs_Value interface { - isMessageWithOneofWKTs_Value() -} - -type MessageWithOneofWKTs_DoubleValue struct { - DoubleValue *types.DoubleValue `protobuf:"bytes,1,opt,name=double_value,json=doubleValue,proto3,oneof" json:"double_value,omitempty"` -} -type MessageWithOneofWKTs_FloatValue struct { - FloatValue *types.FloatValue `protobuf:"bytes,2,opt,name=float_value,json=floatValue,proto3,oneof" json:"float_value,omitempty"` -} -type MessageWithOneofWKTs_Int32Value struct { - Int32Value *types.Int32Value `protobuf:"bytes,3,opt,name=int32_value,json=int32Value,proto3,oneof" json:"int32_value,omitempty"` -} -type MessageWithOneofWKTs_Int64Value struct { - Int64Value *types.Int64Value `protobuf:"bytes,4,opt,name=int64_value,json=int64Value,proto3,oneof" json:"int64_value,omitempty"` -} -type MessageWithOneofWKTs_Uint32Value struct { - Uint32Value *types.UInt32Value `protobuf:"bytes,5,opt,name=uint32_value,json=uint32Value,proto3,oneof" json:"uint32_value,omitempty"` -} -type MessageWithOneofWKTs_Uint64Value struct { - Uint64Value *types.UInt64Value `protobuf:"bytes,6,opt,name=uint64_value,json=uint64Value,proto3,oneof" json:"uint64_value,omitempty"` -} -type MessageWithOneofWKTs_BoolValue struct { - BoolValue *types.BoolValue `protobuf:"bytes,7,opt,name=bool_value,json=boolValue,proto3,oneof" json:"bool_value,omitempty"` -} -type MessageWithOneofWKTs_StringValue struct { - StringValue *types.StringValue `protobuf:"bytes,8,opt,name=string_value,json=stringValue,proto3,oneof" json:"string_value,omitempty"` -} -type MessageWithOneofWKTs_BytesValue struct { - BytesValue *types.BytesValue `protobuf:"bytes,9,opt,name=bytes_value,json=bytesValue,proto3,oneof" json:"bytes_value,omitempty"` -} -type MessageWithOneofWKTs_EmptyValue struct { - EmptyValue *types.Empty `protobuf:"bytes,10,opt,name=empty_value,json=emptyValue,proto3,oneof" json:"empty_value,omitempty"` -} -type MessageWithOneofWKTs_TimestampValue struct { - TimestampValue *types.Timestamp `protobuf:"bytes,11,opt,name=timestamp_value,json=timestampValue,proto3,oneof" json:"timestamp_value,omitempty"` -} -type MessageWithOneofWKTs_DurationValue struct { - DurationValue *types.Duration `protobuf:"bytes,12,opt,name=duration_value,json=durationValue,proto3,oneof" json:"duration_value,omitempty"` -} -type MessageWithOneofWKTs_FieldMaskValue struct { - FieldMaskValue *types.FieldMask `protobuf:"bytes,13,opt,name=field_mask_value,json=fieldMaskValue,proto3,oneof" json:"field_mask_value,omitempty"` -} -type MessageWithOneofWKTs_ValueValue struct { - ValueValue *types.Value `protobuf:"bytes,14,opt,name=value_value,json=valueValue,proto3,oneof" json:"value_value,omitempty"` -} -type MessageWithOneofWKTs_ListValueValue struct { - ListValueValue *types.ListValue `protobuf:"bytes,15,opt,name=list_value_value,json=listValueValue,proto3,oneof" json:"list_value_value,omitempty"` -} -type MessageWithOneofWKTs_StructValue struct { - StructValue *types.Struct `protobuf:"bytes,16,opt,name=struct_value,json=structValue,proto3,oneof" json:"struct_value,omitempty"` -} -type MessageWithOneofWKTs_AnyValue struct { - AnyValue *types.Any `protobuf:"bytes,17,opt,name=any_value,json=anyValue,proto3,oneof" json:"any_value,omitempty"` -} - -func (*MessageWithOneofWKTs_DoubleValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_FloatValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Int32Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Int64Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Uint32Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_Uint64Value) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_BoolValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_StringValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_BytesValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_EmptyValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_TimestampValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_DurationValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_FieldMaskValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_ValueValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_ListValueValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_StructValue) isMessageWithOneofWKTs_Value() {} -func (*MessageWithOneofWKTs_AnyValue) isMessageWithOneofWKTs_Value() {} - -func (m *MessageWithOneofWKTs) GetValue() isMessageWithOneofWKTs_Value { - if m != nil { - return m.Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetDoubleValue() *types.DoubleValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_DoubleValue); ok { - return x.DoubleValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetFloatValue() *types.FloatValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_FloatValue); ok { - return x.FloatValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetInt32Value() *types.Int32Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int32Value); ok { - return x.Int32Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetInt64Value() *types.Int64Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Int64Value); ok { - return x.Int64Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetUint32Value() *types.UInt32Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint32Value); ok { - return x.Uint32Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetUint64Value() *types.UInt64Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_Uint64Value); ok { - return x.Uint64Value - } - return nil -} - -func (m *MessageWithOneofWKTs) GetBoolValue() *types.BoolValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_BoolValue); ok { - return x.BoolValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetStringValue() *types.StringValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_StringValue); ok { - return x.StringValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetBytesValue() *types.BytesValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_BytesValue); ok { - return x.BytesValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetEmptyValue() *types.Empty { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_EmptyValue); ok { - return x.EmptyValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetTimestampValue() *types.Timestamp { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_TimestampValue); ok { - return x.TimestampValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetDurationValue() *types.Duration { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_DurationValue); ok { - return x.DurationValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetFieldMaskValue() *types.FieldMask { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_FieldMaskValue); ok { - return x.FieldMaskValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetValueValue() *types.Value { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_ValueValue); ok { - return x.ValueValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetListValueValue() *types.ListValue { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_ListValueValue); ok { - return x.ListValueValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetStructValue() *types.Struct { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_StructValue); ok { - return x.StructValue - } - return nil -} - -func (m *MessageWithOneofWKTs) GetAnyValue() *types.Any { - if x, ok := m.GetValue().(*MessageWithOneofWKTs_AnyValue); ok { - return x.AnyValue - } - return nil -} - -// XXX_OneofWrappers is for the internal use of the proto package. -func (*MessageWithOneofWKTs) XXX_OneofWrappers() []interface{} { - return []interface{}{ - (*MessageWithOneofWKTs_DoubleValue)(nil), - (*MessageWithOneofWKTs_FloatValue)(nil), - (*MessageWithOneofWKTs_Int32Value)(nil), - (*MessageWithOneofWKTs_Int64Value)(nil), - (*MessageWithOneofWKTs_Uint32Value)(nil), - (*MessageWithOneofWKTs_Uint64Value)(nil), - (*MessageWithOneofWKTs_BoolValue)(nil), - (*MessageWithOneofWKTs_StringValue)(nil), - (*MessageWithOneofWKTs_BytesValue)(nil), - (*MessageWithOneofWKTs_EmptyValue)(nil), - (*MessageWithOneofWKTs_TimestampValue)(nil), - (*MessageWithOneofWKTs_DurationValue)(nil), - (*MessageWithOneofWKTs_FieldMaskValue)(nil), - (*MessageWithOneofWKTs_ValueValue)(nil), - (*MessageWithOneofWKTs_ListValueValue)(nil), - (*MessageWithOneofWKTs_StructValue)(nil), - (*MessageWithOneofWKTs_AnyValue)(nil), - } -} - -type MessageWithWKTMaps struct { - StringDoubleMap map[string]*types.DoubleValue `protobuf:"bytes,1,rep,name=string_double_map,json=stringDoubleMap,proto3" json:"string_double_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFloatMap map[string]*types.FloatValue `protobuf:"bytes,2,rep,name=string_float_map,json=stringFloatMap,proto3" json:"string_float_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt32Map map[string]*types.Int32Value `protobuf:"bytes,3,rep,name=string_int32_map,json=stringInt32Map,proto3" json:"string_int32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringInt64Map map[string]*types.Int64Value `protobuf:"bytes,4,rep,name=string_int64_map,json=stringInt64Map,proto3" json:"string_int64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint32Map map[string]*types.UInt32Value `protobuf:"bytes,5,rep,name=string_uint32_map,json=stringUint32Map,proto3" json:"string_uint32_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringUint64Map map[string]*types.UInt64Value `protobuf:"bytes,6,rep,name=string_uint64_map,json=stringUint64Map,proto3" json:"string_uint64_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBoolMap map[string]*types.BoolValue `protobuf:"bytes,7,rep,name=string_bool_map,json=stringBoolMap,proto3" json:"string_bool_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStringMap map[string]*types.StringValue `protobuf:"bytes,8,rep,name=string_string_map,json=stringStringMap,proto3" json:"string_string_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringBytesMap map[string]*types.BytesValue `protobuf:"bytes,9,rep,name=string_bytes_map,json=stringBytesMap,proto3" json:"string_bytes_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringEmptyMap map[string]*types.Empty `protobuf:"bytes,10,rep,name=string_empty_map,json=stringEmptyMap,proto3" json:"string_empty_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringTimestampMap map[string]*types.Timestamp `protobuf:"bytes,11,rep,name=string_timestamp_map,json=stringTimestampMap,proto3" json:"string_timestamp_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringDurationMap map[string]*types.Duration `protobuf:"bytes,12,rep,name=string_duration_map,json=stringDurationMap,proto3" json:"string_duration_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringFieldMaskMap map[string]*types.FieldMask `protobuf:"bytes,13,rep,name=string_field_mask_map,json=stringFieldMaskMap,proto3" json:"string_field_mask_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringValueMap map[string]*types.Value `protobuf:"bytes,14,rep,name=string_value_map,json=stringValueMap,proto3" json:"string_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringListValueMap map[string]*types.ListValue `protobuf:"bytes,15,rep,name=string_list_value_map,json=stringListValueMap,proto3" json:"string_list_value_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringStructMap map[string]*types.Struct `protobuf:"bytes,16,rep,name=string_struct_map,json=stringStructMap,proto3" json:"string_struct_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - StringAnyMap map[string]*types.Any `protobuf:"bytes,17,rep,name=string_any_map,json=stringAnyMap,proto3" json:"string_any_map,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - XXX_NoUnkeyedLiteral struct{} `json:"-"` - XXX_unrecognized []byte `json:"-"` - XXX_sizecache int32 `json:"-"` -} - -func (m *MessageWithWKTMaps) Reset() { *m = MessageWithWKTMaps{} } -func (m *MessageWithWKTMaps) String() string { return proto.CompactTextString(m) } -func (*MessageWithWKTMaps) ProtoMessage() {} -func (*MessageWithWKTMaps) Descriptor() ([]byte, []int) { - return fileDescriptor_4f76f3479ade79d3, []int{2} -} -func (m *MessageWithWKTMaps) XXX_Unmarshal(b []byte) error { - return xxx_messageInfo_MessageWithWKTMaps.Unmarshal(m, b) -} -func (m *MessageWithWKTMaps) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - return xxx_messageInfo_MessageWithWKTMaps.Marshal(b, m, deterministic) -} -func (m *MessageWithWKTMaps) XXX_Merge(src proto.Message) { - xxx_messageInfo_MessageWithWKTMaps.Merge(m, src) -} -func (m *MessageWithWKTMaps) XXX_Size() int { - return xxx_messageInfo_MessageWithWKTMaps.Size(m) -} -func (m *MessageWithWKTMaps) XXX_DiscardUnknown() { - xxx_messageInfo_MessageWithWKTMaps.DiscardUnknown(m) -} - -var xxx_messageInfo_MessageWithWKTMaps proto.InternalMessageInfo - -func (m *MessageWithWKTMaps) GetStringDoubleMap() map[string]*types.DoubleValue { - if m != nil { - return m.StringDoubleMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringFloatMap() map[string]*types.FloatValue { - if m != nil { - return m.StringFloatMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringInt32Map() map[string]*types.Int32Value { - if m != nil { - return m.StringInt32Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringInt64Map() map[string]*types.Int64Value { - if m != nil { - return m.StringInt64Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringUint32Map() map[string]*types.UInt32Value { - if m != nil { - return m.StringUint32Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringUint64Map() map[string]*types.UInt64Value { - if m != nil { - return m.StringUint64Map - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringBoolMap() map[string]*types.BoolValue { - if m != nil { - return m.StringBoolMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringStringMap() map[string]*types.StringValue { - if m != nil { - return m.StringStringMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringBytesMap() map[string]*types.BytesValue { - if m != nil { - return m.StringBytesMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringEmptyMap() map[string]*types.Empty { - if m != nil { - return m.StringEmptyMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringTimestampMap() map[string]*types.Timestamp { - if m != nil { - return m.StringTimestampMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringDurationMap() map[string]*types.Duration { - if m != nil { - return m.StringDurationMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringFieldMaskMap() map[string]*types.FieldMask { - if m != nil { - return m.StringFieldMaskMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringValueMap() map[string]*types.Value { - if m != nil { - return m.StringValueMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringListValueMap() map[string]*types.ListValue { - if m != nil { - return m.StringListValueMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringStructMap() map[string]*types.Struct { - if m != nil { - return m.StringStructMap - } - return nil -} - -func (m *MessageWithWKTMaps) GetStringAnyMap() map[string]*types.Any { - if m != nil { - return m.StringAnyMap - } - return nil -} - -func init() { - proto.RegisterType((*MessageWithWKTs)(nil), "thethings.flags.test.MessageWithWKTs") - proto.RegisterType((*MessageWithOneofWKTs)(nil), "thethings.flags.test.MessageWithOneofWKTs") - proto.RegisterType((*MessageWithWKTMaps)(nil), "thethings.flags.test.MessageWithWKTMaps") - proto.RegisterMapType((map[string]*types.Any)(nil), "thethings.flags.test.MessageWithWKTMaps.StringAnyMapEntry") - proto.RegisterMapType((map[string]*types.BoolValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringBoolMapEntry") - proto.RegisterMapType((map[string]*types.BytesValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringBytesMapEntry") - proto.RegisterMapType((map[string]*types.DoubleValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringDoubleMapEntry") - proto.RegisterMapType((map[string]*types.Duration)(nil), "thethings.flags.test.MessageWithWKTMaps.StringDurationMapEntry") - proto.RegisterMapType((map[string]*types.Empty)(nil), "thethings.flags.test.MessageWithWKTMaps.StringEmptyMapEntry") - proto.RegisterMapType((map[string]*types.FieldMask)(nil), "thethings.flags.test.MessageWithWKTMaps.StringFieldMaskMapEntry") - proto.RegisterMapType((map[string]*types.FloatValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringFloatMapEntry") - proto.RegisterMapType((map[string]*types.Int32Value)(nil), "thethings.flags.test.MessageWithWKTMaps.StringInt32MapEntry") - proto.RegisterMapType((map[string]*types.Int64Value)(nil), "thethings.flags.test.MessageWithWKTMaps.StringInt64MapEntry") - proto.RegisterMapType((map[string]*types.ListValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringListValueMapEntry") - proto.RegisterMapType((map[string]*types.StringValue)(nil), "thethings.flags.test.MessageWithWKTMaps.StringStringMapEntry") - proto.RegisterMapType((map[string]*types.Struct)(nil), "thethings.flags.test.MessageWithWKTMaps.StringStructMapEntry") - proto.RegisterMapType((map[string]*types.Timestamp)(nil), "thethings.flags.test.MessageWithWKTMaps.StringTimestampMapEntry") - proto.RegisterMapType((map[string]*types.UInt32Value)(nil), "thethings.flags.test.MessageWithWKTMaps.StringUint32MapEntry") - proto.RegisterMapType((map[string]*types.UInt64Value)(nil), "thethings.flags.test.MessageWithWKTMaps.StringUint64MapEntry") - proto.RegisterMapType((map[string]*types.Value)(nil), "thethings.flags.test.MessageWithWKTMaps.StringValueMapEntry") -} - -func init() { proto.RegisterFile("wkts.proto", fileDescriptor_4f76f3479ade79d3) } - -var fileDescriptor_4f76f3479ade79d3 = []byte{ - // 1596 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x59, 0x5d, 0x53, 0xdb, 0x46, - 0x14, 0x85, 0xf0, 0x65, 0xaf, 0x8c, 0x3f, 0x14, 0x92, 0x08, 0x48, 0x13, 0xca, 0x53, 0xa7, 0x53, - 0x4c, 0x13, 0x18, 0x52, 0x08, 0x4d, 0x02, 0x0d, 0x0c, 0x99, 0x96, 0xe9, 0x8c, 0x0b, 0xcd, 0xf4, - 0x63, 0x4a, 0x64, 0x23, 0x1b, 0x0d, 0xb6, 0xe4, 0xf1, 0x4a, 0xc9, 0xf0, 0x3b, 0x3a, 0xfd, 0x13, - 0xfd, 0x79, 0x7d, 0xe8, 0x73, 0x67, 0x57, 0x77, 0xb5, 0x77, 0x25, 0xad, 0x54, 0xeb, 0x25, 0x91, - 0x77, 0xf7, 0x9e, 0x73, 0xef, 0xee, 0xea, 0x9c, 0xd5, 0x42, 0xc8, 0xa7, 0xdb, 0x80, 0xb6, 0xc7, - 0x13, 0x3f, 0xf0, 0xcd, 0x95, 0xe0, 0xc6, 0x09, 0x6e, 0x5c, 0x6f, 0x40, 0xdb, 0xfd, 0xa1, 0x3d, - 0xa0, 0xed, 0xc0, 0xa1, 0xc1, 0x5a, 0xcb, 0xf6, 0x3c, 0x3f, 0xb0, 0x03, 0xd7, 0xf7, 0x60, 0xe0, - 0xda, 0xea, 0xc0, 0xf7, 0x07, 0x43, 0x67, 0x9b, 0xff, 0xea, 0x86, 0xfd, 0x6d, 0xdb, 0xbb, 0x83, - 0xae, 0x27, 0xc9, 0xae, 0xeb, 0x70, 0xc2, 0x63, 0xa1, 0x7f, 0x3d, 0xd9, 0xef, 0x8c, 0xc6, 0x81, - 0x08, 0xde, 0x48, 0x76, 0xf6, 0x5d, 0x67, 0x78, 0x7d, 0x35, 0xb2, 0xe9, 0x2d, 0x8c, 0x78, 0x9c, - 0x1c, 0x41, 0x83, 0x49, 0xd8, 0x0b, 0xa0, 0xf7, 0x69, 0xb2, 0x37, 0x70, 0x47, 0x0e, 0x0d, 0xec, - 0xd1, 0x58, 0x97, 0xdd, 0xa7, 0x89, 0x3d, 0x1e, 0x3b, 0x13, 0x28, 0x6c, 0xf3, 0xcf, 0x16, 0x69, - 0x9c, 0x3b, 0x94, 0xda, 0x03, 0xe7, 0xbd, 0x1b, 0xdc, 0xbc, 0xff, 0xfe, 0x82, 0x9a, 0xaf, 0x49, - 0xed, 0xda, 0x0f, 0xbb, 0x43, 0xe7, 0xea, 0xa3, 0x3d, 0x0c, 0x1d, 0x6b, 0x76, 0x63, 0xf6, 0x0b, - 0xe3, 0xf9, 0xe3, 0x76, 0x04, 0xd5, 0x16, 0x50, 0xed, 0xb7, 0x7c, 0xd0, 0xcf, 0x6c, 0x4c, 0xc7, - 0xb8, 0x96, 0x3f, 0xcc, 0x23, 0xb2, 0x8c, 0x01, 0xa8, 0x75, 0x6f, 0x63, 0xae, 0x10, 0xa1, 0x86, - 0x10, 0xa8, 0x79, 0x48, 0x8c, 0xfe, 0xd0, 0xb7, 0x03, 0x48, 0x61, 0x8e, 0xa7, 0xb0, 0x9e, 0x02, - 0x38, 0x65, 0x63, 0xa2, 0x78, 0xd2, 0x8f, 0x9f, 0xcd, 0x57, 0xa4, 0x86, 0xa2, 0xa9, 0x35, 0xcf, - 0xf9, 0x73, 0xc3, 0x0d, 0x19, 0xce, 0xd9, 0x5d, 0x2f, 0xd8, 0x79, 0x0e, 0xec, 0x0b, 0x1a, 0xf6, - 0x77, 0x6c, 0x0c, 0xb0, 0xbb, 0xf1, 0x33, 0x63, 0x47, 0xd1, 0xd4, 0x5a, 0xd4, 0xb0, 0xa3, 0x70, - 0x43, 0x86, 0x0b, 0xf6, 0xbd, 0x5d, 0x60, 0x5f, 0xd2, 0xb3, 0xef, 0xed, 0x4a, 0x76, 0x78, 0x06, - 0x76, 0x11, 0x4d, 0xad, 0x8a, 0x9e, 0x5d, 0x84, 0x1b, 0x32, 0x9c, 0xaf, 0x7e, 0x88, 0x8b, 0xaf, - 0x6a, 0x56, 0xff, 0x12, 0xa7, 0x1f, 0xa2, 0xf2, 0x8f, 0xc8, 0x72, 0xa8, 0xd4, 0x4f, 0x34, 0xab, - 0x8f, 0x11, 0x6a, 0x21, 0x9e, 0x01, 0xc8, 0x21, 0x9e, 0x02, 0x23, 0x27, 0x87, 0xb8, 0x88, 0x10, - 0x4d, 0x02, 0xe4, 0x20, 0x67, 0xa1, 0x96, 0x93, 0x83, 0x40, 0xa8, 0x85, 0x78, 0x1e, 0xf6, 0x09, - 0xe9, 0xfa, 0xfe, 0x10, 0x32, 0x58, 0xe6, 0x19, 0xac, 0xa5, 0xe2, 0x8f, 0x7d, 0x7f, 0x18, 0x45, - 0x57, 0xbb, 0xe2, 0xd1, 0x7c, 0x49, 0x0c, 0x19, 0x4a, 0xad, 0x3a, 0xe7, 0xce, 0x8b, 0x25, 0x71, - 0x2c, 0xaf, 0x9d, 0x06, 0x13, 0xd7, 0x1b, 0x00, 0x73, 0x43, 0x53, 0xfb, 0x4f, 0x7c, 0x10, 0xd4, - 0x4e, 0xe5, 0x0f, 0x56, 0x3b, 0x06, 0xa0, 0x56, 0x53, 0x53, 0x3b, 0x46, 0xa8, 0x21, 0x04, 0xbe, - 0x03, 0xbb, 0x77, 0x81, 0x43, 0x21, 0x85, 0x96, 0x66, 0x07, 0x1e, 0xb3, 0x31, 0xa2, 0x82, 0xf8, - 0x99, 0xed, 0x40, 0x14, 0x4d, 0x2d, 0x53, 0xb3, 0x03, 0x51, 0xb8, 0x21, 0xc3, 0xa9, 0xf9, 0x82, - 0x18, 0x5c, 0x23, 0x81, 0xfd, 0x3e, 0x67, 0x7f, 0x98, 0x0a, 0x3f, 0x61, 0x63, 0x3a, 0x84, 0x0f, - 0x8d, 0x88, 0xf7, 0x49, 0x0d, 0x05, 0x52, 0x6b, 0x85, 0x13, 0xeb, 0x22, 0x0d, 0x19, 0x49, 0xcd, - 0xef, 0x48, 0x23, 0x96, 0x4e, 0xe0, 0x7d, 0xa0, 0x59, 0xf2, 0x0b, 0x31, 0xae, 0x53, 0x8f, 0x43, - 0x22, 0xfe, 0x13, 0xd2, 0x4c, 0x80, 0x50, 0xeb, 0xa1, 0x66, 0xf1, 0x25, 0x4a, 0x43, 0x45, 0xa1, - 0xe6, 0x1b, 0x52, 0x17, 0x1e, 0x02, 0xa9, 0x3c, 0xe2, 0xa9, 0xac, 0xa6, 0xf5, 0x13, 0x86, 0x75, - 0x96, 0x45, 0x40, 0x94, 0xc8, 0x31, 0x69, 0xa8, 0x08, 0xd4, 0xb2, 0x78, 0x1e, 0x39, 0x10, 0x75, - 0x05, 0x82, 0x9a, 0x6f, 0x49, 0x53, 0x9a, 0x11, 0xe4, 0xb1, 0xaa, 0x99, 0x92, 0x53, 0x36, 0xf0, - 0xdc, 0xa6, 0xb7, 0x9d, 0x7a, 0x5f, 0x3c, 0x46, 0x99, 0x9c, 0x92, 0x56, 0x12, 0x85, 0x5a, 0x6b, - 0x9a, 0x39, 0x91, 0x30, 0x0d, 0x15, 0x86, 0xef, 0x09, 0x1e, 0x0c, 0x89, 0xac, 0x6b, 0xf6, 0x04, - 0x6c, 0x46, 0x3e, 0x28, 0xde, 0x13, 0x28, 0x90, 0x5a, 0x8f, 0x35, 0x7b, 0x02, 0xf6, 0xa1, 0x8c, - 0xe4, 0x33, 0x30, 0x74, 0x29, 0x98, 0x08, 0x10, 0x7f, 0xa6, 0x99, 0x81, 0x1f, 0x5c, 0x0a, 0x46, - 0x52, 0x1f, 0x8a, 0xc7, 0x78, 0x06, 0x92, 0x28, 0xd4, 0x7a, 0xa2, 0x99, 0x01, 0x09, 0xd3, 0x50, - 0x61, 0xa8, 0x79, 0xc0, 0x75, 0x21, 0xec, 0x09, 0x4b, 0x7c, 0xca, 0x33, 0x79, 0x94, 0xf5, 0x56, - 0x87, 0xbd, 0x80, 0x4b, 0x42, 0xd8, 0x03, 0x3f, 0x3c, 0xe4, 0x92, 0x10, 0xc7, 0x52, 0x6b, 0x83, - 0xf3, 0x6b, 0x83, 0x6b, 0x28, 0x98, 0x9a, 0xcf, 0x48, 0xd5, 0xf6, 0xc4, 0xdb, 0xf8, 0x39, 0xa7, - 0x5d, 0x49, 0x45, 0x1e, 0x79, 0x77, 0x9d, 0x8a, 0xed, 0xc1, 0x9b, 0xb8, 0x43, 0x48, 0x1c, 0x42, - 0xad, 0x4d, 0xce, 0x96, 0x1d, 0x53, 0x15, 0x31, 0xf4, 0xa0, 0xf2, 0xcf, 0xdf, 0xab, 0xf3, 0x95, - 0xd9, 0xe6, 0xec, 0xe6, 0xbf, 0x15, 0xb2, 0x82, 0x4e, 0x25, 0x3f, 0x7a, 0x8e, 0xdf, 0xe7, 0x47, - 0x93, 0xa3, 0xe9, 0x8f, 0x26, 0x67, 0x33, 0xea, 0xe1, 0xe4, 0x95, 0x7a, 0xb2, 0xb8, 0x57, 0x78, - 0xb2, 0x38, 0x9b, 0x49, 0x9c, 0x2d, 0x94, 0xb3, 0xc1, 0x5c, 0xe1, 0xd9, 0x80, 0xc5, 0x2b, 0xa7, - 0x03, 0xc5, 0xdd, 0xe7, 0x0b, 0xdd, 0x1d, 0xe2, 0xa5, 0xb5, 0xa9, 0xfe, 0xbc, 0x50, 0xec, 0xcf, - 0x6c, 0x0a, 0x54, 0x87, 0x56, 0xed, 0x75, 0xb1, 0xd8, 0x5e, 0x05, 0x84, 0xc8, 0xe2, 0xa5, 0xe2, - 0x8e, 0x4b, 0x45, 0xee, 0x78, 0x36, 0x83, 0xfd, 0xf1, 0x28, 0x61, 0x71, 0x95, 0x62, 0x8b, 0x63, - 0xfc, 0xd8, 0xe4, 0x5e, 0xa9, 0x0e, 0x55, 0x2d, 0x74, 0x28, 0x36, 0x8b, 0xc8, 0xa3, 0xf6, 0x55, - 0x8f, 0x21, 0x79, 0x1e, 0xc3, 0x42, 0x91, 0xcb, 0x9c, 0xa4, 0xad, 0xc2, 0x28, 0xb2, 0x8a, 0xb3, - 0x99, 0x94, 0x59, 0x1c, 0xa7, 0x54, 0xbe, 0x56, 0xa0, 0xf2, 0x67, 0x33, 0x49, 0x9d, 0x3f, 0xcd, - 0xd0, 0xe8, 0xe5, 0x22, 0x8d, 0x66, 0xb9, 0x24, 0x54, 0x7a, 0x5f, 0x55, 0xd7, 0x7a, 0x9e, 0xba, - 0xb2, 0xd9, 0xf8, 0x88, 0xe5, 0x2d, 0x2d, 0x92, 0x8d, 0x22, 0x91, 0x64, 0x29, 0x24, 0x64, 0xf2, - 0x30, 0x21, 0x6f, 0xcd, 0x5c, 0x79, 0x83, 0xed, 0x10, 0x0b, 0xdc, 0x0e, 0x96, 0xa8, 0x96, 0x5e, - 0xa2, 0xce, 0x66, 0xa4, 0x48, 0x49, 0xbd, 0x39, 0x5e, 0x22, 0x0b, 0x3c, 0x74, 0xf3, 0xaf, 0x75, - 0x62, 0xaa, 0x9f, 0x43, 0xe7, 0xf6, 0x98, 0x9a, 0x2e, 0x69, 0xc1, 0x86, 0x05, 0xf5, 0x19, 0xd9, - 0x63, 0x6b, 0x96, 0xab, 0xda, 0xb7, 0xed, 0xac, 0x6f, 0xc8, 0x76, 0x1a, 0x04, 0x76, 0x73, 0xa4, - 0x4c, 0xe7, 0xf6, 0xf8, 0xc4, 0x0b, 0x26, 0x77, 0x9d, 0x06, 0x55, 0x5b, 0xcd, 0x3e, 0x69, 0x02, - 0x55, 0xa4, 0x52, 0x8c, 0x29, 0xfa, 0x7c, 0x3a, 0x9c, 0x92, 0x89, 0x2b, 0x58, 0x4c, 0x54, 0xa7, - 0x4a, 0x23, 0xe2, 0x89, 0xc4, 0x84, 0xf1, 0xcc, 0x95, 0xe2, 0xe1, 0x3a, 0x93, 0xe4, 0x11, 0x8d, - 0x2a, 0xcf, 0xde, 0x2e, 0xe7, 0x99, 0x2f, 0xcb, 0xb3, 0xb7, 0x9b, 0xc1, 0xc3, 0x1b, 0xd1, 0x12, - 0x85, 0xb2, 0xa0, 0x85, 0x52, 0x4b, 0x74, 0xe9, 0x2a, 0x15, 0xc1, 0x12, 0xc5, 0xad, 0x09, 0x2a, - 0xa8, 0x69, 0xb1, 0x34, 0x15, 0x2a, 0x0a, 0x51, 0x45, 0x55, 0xf5, 0x08, 0x34, 0x5d, 0x71, 0xb5, - 0x65, 0x44, 0x4b, 0x9c, 0xe8, 0xe5, 0x94, 0x44, 0x4c, 0x89, 0x63, 0x1a, 0xf8, 0x3e, 0x80, 0x36, - 0x54, 0x0f, 0xfc, 0xc7, 0x68, 0x2a, 0xa5, 0xea, 0x89, 0xfe, 0x4d, 0xd6, 0x13, 0xb7, 0xa2, 0xdd, - 0x10, 0xa9, 0x37, 0x63, 0xaa, 0x96, 0xda, 0x0d, 0x5c, 0xd9, 0x93, 0xbb, 0x41, 0x34, 0x22, 0x9e, - 0x48, 0xe5, 0x19, 0x0f, 0x29, 0xc5, 0xc3, 0x1d, 0x20, 0xc9, 0x23, 0x1a, 0xcd, 0x09, 0x59, 0x01, - 0x1e, 0x69, 0x09, 0x8c, 0xcb, 0xe0, 0x5c, 0x6f, 0xa6, 0xe4, 0x8a, 0xed, 0x22, 0xe6, 0x33, 0x69, - 0xaa, 0xc3, 0xf4, 0xc9, 0x7d, 0x21, 0x46, 0xc2, 0x3f, 0x18, 0x65, 0xf4, 0x85, 0xfb, 0x7a, 0x5a, - 0x39, 0x02, 0x88, 0x98, 0x11, 0xb6, 0x02, 0x6a, 0x37, 0x29, 0x79, 0x20, 0x24, 0x49, 0x9a, 0x0d, - 0xa3, 0x5c, 0x2e, 0x55, 0x65, 0x6c, 0x44, 0xc9, 0x2a, 0x71, 0x07, 0x5a, 0xc1, 0xc8, 0x59, 0x18, - 0x5f, 0xbd, 0xd4, 0x0a, 0x72, 0xb1, 0x4f, 0xae, 0xa0, 0x68, 0x44, 0xc5, 0x21, 0x1b, 0x63, 0x64, - 0x8d, 0x52, 0xc5, 0xc5, 0x16, 0x97, 0x2c, 0x0e, 0x77, 0xa8, 0x6f, 0x1c, 0xf3, 0x3c, 0x46, 0xd8, - 0x2c, 0xfb, 0xc6, 0x85, 0xbd, 0x20, 0xe3, 0x8d, 0x8b, 0x5a, 0xcd, 0x0f, 0x04, 0x2a, 0xbe, 0x62, - 0x06, 0xc9, 0x78, 0x5a, 0x9c, 0xe7, 0x60, 0x4a, 0x9e, 0x23, 0x4f, 0xbe, 0x05, 0x70, 0x7a, 0x8b, - 0x9a, 0xd6, 0x3e, 0x90, 0x95, 0x2c, 0x6b, 0x33, 0x9b, 0x64, 0xee, 0xd6, 0xb9, 0xe3, 0x47, 0xf4, - 0x6a, 0x87, 0x3d, 0x9a, 0xcf, 0xc1, 0x66, 0xe1, 0xd0, 0x9d, 0x7f, 0x1f, 0x18, 0x0d, 0x3d, 0xb8, - 0xf7, 0xcd, 0xec, 0xda, 0x1f, 0xe4, 0x7e, 0x86, 0xa5, 0x65, 0x10, 0x3c, 0x53, 0x09, 0x72, 0x2f, - 0xfc, 0xb2, 0xf0, 0x15, 0x2b, 0x2b, 0x83, 0x8f, 0x6e, 0xb4, 0x34, 0xf8, 0x52, 0xed, 0x4b, 0xe2, - 0x8b, 0xdb, 0x2a, 0x84, 0x1f, 0xaf, 0x80, 0xea, 0x5c, 0x65, 0x56, 0xe0, 0x32, 0xbb, 0x02, 0x85, - 0x21, 0xb7, 0x84, 0xff, 0xc5, 0x90, 0x51, 0xc3, 0xef, 0xc4, 0x4c, 0x3b, 0x55, 0x06, 0xfe, 0xd7, - 0x2a, 0x7e, 0xde, 0xad, 0x5a, 0x56, 0xfe, 0xaa, 0x41, 0x95, 0xc9, 0x1f, 0xdf, 0x9a, 0x65, 0xad, - 0xb1, 0x62, 0x4c, 0x65, 0xd6, 0x18, 0x5d, 0x8b, 0x21, 0xfc, 0x5f, 0x04, 0xbe, 0x62, 0x48, 0x19, - 0xf8, 0x5f, 0xa9, 0xf8, 0xba, 0xdb, 0x2f, 0x04, 0x6d, 0x93, 0x47, 0x1a, 0xff, 0x29, 0x33, 0xff, - 0xf2, 0x62, 0x0b, 0x51, 0x5c, 0x91, 0x87, 0xd9, 0x7e, 0x93, 0xc1, 0xb0, 0xad, 0x32, 0xe4, 0x5c, - 0x59, 0x65, 0xd5, 0x90, 0x72, 0x97, 0x32, 0x35, 0xc8, 0x8b, 0xa8, 0xac, 0x15, 0x50, 0xf4, 0xbd, - 0xcc, 0x0a, 0xa4, 0x16, 0x37, 0xce, 0x3e, 0x65, 0x1f, 0x65, 0xb2, 0x97, 0x97, 0x48, 0x88, 0xe2, - 0x37, 0xf4, 0x06, 0x20, 0xc3, 0xc8, 0xc0, 0xdf, 0x52, 0xf1, 0xb5, 0x97, 0x44, 0x08, 0xfc, 0x92, - 0xb4, 0x52, 0x2e, 0x91, 0x81, 0xfc, 0xa5, 0x8a, 0x9c, 0x7d, 0x21, 0x24, 0x61, 0xd1, 0x07, 0xda, - 0xfe, 0xaf, 0x2f, 0x06, 0x6e, 0x70, 0x13, 0x76, 0xdb, 0x3d, 0x7f, 0xb4, 0x7d, 0x71, 0xe3, 0x5c, - 0x70, 0xe7, 0x7a, 0xe7, 0x5d, 0x87, 0xcc, 0x8b, 0x1c, 0x1a, 0xfd, 0x81, 0xab, 0xb7, 0x35, 0x70, - 0xbc, 0xad, 0x81, 0xbf, 0xc5, 0x1d, 0x6d, 0x9b, 0x39, 0x5a, 0x77, 0x91, 0xf7, 0xec, 0xfc, 0x17, - 0x00, 0x00, 0xff, 0xff, 0xb8, 0x82, 0x62, 0x61, 0xf8, 0x1b, 0x00, 0x00, -} diff --git a/test/gogo/wkts_flags.pb.go b/test/gogo/wkts_flags.pb.go deleted file mode 100644 index 4f79749..0000000 --- a/test/gogo/wkts_flags.pb.go +++ /dev/null @@ -1,932 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.9.1 -// source: wkts.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - gogo "github.com/TheThingsIndustries/protoc-gen-go-flags/gogo" - types "github.com/gogo/protobuf/types" - pflag "github.com/spf13/pflag" -) - -// AddSelectFlagsForMessageWithWKTs adds flags to select fields in MessageWithWKTs. -func AddSelectFlagsForMessageWithWKTs(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("double-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("double-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("double-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("double-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("float-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("float-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("float-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("float-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("int64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("int64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint32-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint32-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("uint64-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("uint64-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bool-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bool-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bytes-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("bytes-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("empty-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("empty-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("empty-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("empty-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("timestamp-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("timestamp-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("timestamp-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("timestamp-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("duration-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("duration-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("duration-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("duration-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("field-mask-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("field-mask-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("field-mask-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("field-mask-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("list-value-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("list-value-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("list-value-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("list-value-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("struct-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("struct-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("struct-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("struct-values", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("any-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("any-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("any-values", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("any-values", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithWKTs message from select flags. -func PathsFromSelectFlagsForMessageWithWKTs(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("double_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("double_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("double_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("double_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("float_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("float_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("float_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("float_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("int64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("int64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint32_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint32_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("uint64_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("uint64_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bool_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bytes_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bytes_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("bytes_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("empty_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("empty_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("empty_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("empty_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("timestamp_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("timestamp_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("timestamp_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("timestamp_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("duration_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("duration_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("duration_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("duration_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("field_mask_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("field_mask_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("field_mask_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("field_mask_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("list_value_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("list_value_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("list_value_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("list_value_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("struct_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("struct_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("struct_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("struct_values", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("any_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("any_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("any_values", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("any_values", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithWKTs adds flags to select fields in MessageWithWKTs. -func AddSetFlagsForMessageWithWKTs(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewFloat64Flag(flagsplugin.Prefix("double-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat64SliceFlag(flagsplugin.Prefix("double-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32Flag(flagsplugin.Prefix("float-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32SliceFlag(flagsplugin.Prefix("float-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("int32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32SliceFlag(flagsplugin.Prefix("int32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("int64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64SliceFlag(flagsplugin.Prefix("int64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("uint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32SliceFlag(flagsplugin.Prefix("uint32-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("uint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64SliceFlag(flagsplugin.Prefix("uint64-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("bool-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolSliceFlag(flagsplugin.Prefix("bool-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("string-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesSliceFlag(flagsplugin.Prefix("bytes-values", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping EmptyValue because this WKT is currently not supported. - // FIXME: Skipping EmptyValues because this repeated WKT is currently not supported. - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("timestamp-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewTimestampSliceFlag(flagsplugin.Prefix("timestamp-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("duration-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationSliceFlag(flagsplugin.Prefix("duration-values", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("field-mask-value", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping FieldMaskValues because this repeated WKT is currently not supported. - // FIXME: Skipping ValueValue because this WKT is currently not supported. - // FIXME: Skipping ValueValues because this repeated WKT is currently not supported. - // FIXME: Skipping ListValueValue because this WKT is currently not supported. - // FIXME: Skipping ListValueValues because this repeated WKT is currently not supported. - // FIXME: Skipping StructValue because this WKT is currently not supported. - // FIXME: Skipping StructValues because this repeated WKT is currently not supported. - // FIXME: Skipping AnyValue because this WKT is currently not supported. - // FIXME: Skipping AnyValues because this repeated WKT is currently not supported. -} - -// SetFromFlags sets the MessageWithWKTs message from flags. -func (m *MessageWithWKTs) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetFloat64(flags, flagsplugin.Prefix("double_value", prefix)); err != nil { - return nil, err - } else if changed { - m.DoubleValue = &types.DoubleValue{Value: val} - paths = append(paths, flagsplugin.Prefix("double_value", prefix)) - } - if val, changed, err := flagsplugin.GetFloat64Slice(flags, flagsplugin.Prefix("double_values", prefix)); err != nil { - return nil, err - } else if changed { - m.DoubleValues = make([]*types.DoubleValue, len(val)) - for i, value := range val { - m.DoubleValues[i] = &types.DoubleValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("double_values", prefix)) - } - if val, changed, err := flagsplugin.GetFloat32(flags, flagsplugin.Prefix("float_value", prefix)); err != nil { - return nil, err - } else if changed { - m.FloatValue = &types.FloatValue{Value: val} - paths = append(paths, flagsplugin.Prefix("float_value", prefix)) - } - if val, changed, err := flagsplugin.GetFloat32Slice(flags, flagsplugin.Prefix("float_values", prefix)); err != nil { - return nil, err - } else if changed { - m.FloatValues = make([]*types.FloatValue, len(val)) - for i, value := range val { - m.FloatValues[i] = &types.FloatValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("float_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("int32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Int32Value = &types.Int32Value{Value: val} - paths = append(paths, flagsplugin.Prefix("int32_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt32Slice(flags, flagsplugin.Prefix("int32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Int32Values = make([]*types.Int32Value, len(val)) - for i, value := range val { - m.Int32Values[i] = &types.Int32Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("int32_values", prefix)) - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("int64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Int64Value = &types.Int64Value{Value: val} - paths = append(paths, flagsplugin.Prefix("int64_value", prefix)) - } - if val, changed, err := flagsplugin.GetInt64Slice(flags, flagsplugin.Prefix("int64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Int64Values = make([]*types.Int64Value, len(val)) - for i, value := range val { - m.Int64Values[i] = &types.Int64Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("int64_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("uint32_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint32Value = &types.UInt32Value{Value: val} - paths = append(paths, flagsplugin.Prefix("uint32_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint32Slice(flags, flagsplugin.Prefix("uint32_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint32Values = make([]*types.UInt32Value, len(val)) - for i, value := range val { - m.Uint32Values[i] = &types.UInt32Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("uint32_values", prefix)) - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("uint64_value", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint64Value = &types.UInt64Value{Value: val} - paths = append(paths, flagsplugin.Prefix("uint64_value", prefix)) - } - if val, changed, err := flagsplugin.GetUint64Slice(flags, flagsplugin.Prefix("uint64_values", prefix)); err != nil { - return nil, err - } else if changed { - m.Uint64Values = make([]*types.UInt64Value, len(val)) - for i, value := range val { - m.Uint64Values[i] = &types.UInt64Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("uint64_values", prefix)) - } - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("bool_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValue = &types.BoolValue{Value: val} - paths = append(paths, flagsplugin.Prefix("bool_value", prefix)) - } - if val, changed, err := flagsplugin.GetBoolSlice(flags, flagsplugin.Prefix("bool_values", prefix)); err != nil { - return nil, err - } else if changed { - m.BoolValues = make([]*types.BoolValue, len(val)) - for i, value := range val { - m.BoolValues[i] = &types.BoolValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("bool_values", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValue = &types.StringValue{Value: val} - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("string_values", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValues = make([]*types.StringValue, len(val)) - for i, value := range val { - m.StringValues[i] = &types.StringValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_values", prefix)) - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - m.BytesValue = &types.BytesValue{Value: val} - paths = append(paths, flagsplugin.Prefix("bytes_value", prefix)) - } - if val, changed, err := flagsplugin.GetBytesSlice(flags, flagsplugin.Prefix("bytes_values", prefix)); err != nil { - return nil, err - } else if changed { - m.BytesValues = make([]*types.BytesValue, len(val)) - for i, value := range val { - m.BytesValues[i] = &types.BytesValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("bytes_values", prefix)) - } - // FIXME: Skipping EmptyValue because this WKT is not supported. - // FIXME: Skipping EmptyValues because this repeated WKT is not supported - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("timestamp_value", prefix)); err != nil { - return nil, err - } else if changed { - m.TimestampValue = gogo.SetTimestamp(val) - paths = append(paths, flagsplugin.Prefix("timestamp_value", prefix)) - } - if val, changed, err := flagsplugin.GetTimestampSlice(flags, flagsplugin.Prefix("timestamp_values", prefix)); err != nil { - return nil, err - } else if changed { - m.TimestampValues = make([]*types.Timestamp, len(val)) - for i, value := range val { - m.TimestampValues[i] = gogo.SetTimestamp(value) - } - paths = append(paths, flagsplugin.Prefix("timestamp_values", prefix)) - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("duration_value", prefix)); err != nil { - return nil, err - } else if changed { - m.DurationValue = gogo.SetDuration(val) - paths = append(paths, flagsplugin.Prefix("duration_value", prefix)) - } - if val, changed, err := flagsplugin.GetDurationSlice(flags, flagsplugin.Prefix("duration_values", prefix)); err != nil { - return nil, err - } else if changed { - m.DurationValues = make([]*types.Duration, len(val)) - for i, value := range val { - m.DurationValues[i] = gogo.SetDuration(value) - } - paths = append(paths, flagsplugin.Prefix("duration_values", prefix)) - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("field_mask_value", prefix)); err != nil { - return nil, err - } else if changed { - m.FieldMaskValue = gogo.SetFieldMask(val) - paths = append(paths, flagsplugin.Prefix("field_mask_value", prefix)) - } - // FIXME: Skipping FieldMaskValues because this repeated WKT is not supported - // FIXME: Skipping ValueValue because this WKT is not supported. - // FIXME: Skipping ValueValues because this repeated WKT is not supported - // FIXME: Skipping ListValueValue because this WKT is not supported. - // FIXME: Skipping ListValueValues because this repeated WKT is not supported - // FIXME: Skipping StructValue because this WKT is not supported. - // FIXME: Skipping StructValues because this repeated WKT is not supported - // FIXME: Skipping AnyValue because this WKT is not supported. - // FIXME: Skipping AnyValues because this repeated WKT is not supported - return paths, nil -} - -// AddSelectFlagsForMessageWithOneofWKTs adds flags to select fields in MessageWithOneofWKTs. -func AddSelectFlagsForMessageWithOneofWKTs(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.double-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.double-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.float-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.float-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.int32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.int32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.int64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.int64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.uint32-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.uint32-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.uint64-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.uint64-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bool-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.bool-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bytes-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.bytes-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.empty-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.empty-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.timestamp-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.timestamp-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.duration-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.duration-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.field-mask-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.field-mask-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.value-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.value-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.list-value-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.list-value-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.struct-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.struct-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.any-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("value.any-value", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithOneofWKTs message from select flags. -func PathsFromSelectFlagsForMessageWithOneofWKTs(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.double_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.double_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.float_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.float_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.int32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.int32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.int64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.int64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.uint32_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.uint32_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.uint64_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.uint64_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bool_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.bool_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bytes_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.bytes_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.empty_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.empty_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.timestamp_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.timestamp_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.duration_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.duration_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.field_mask_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.field_mask_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.value_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.value_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.list_value_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.list_value_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.struct_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.struct_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.any_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("value.any_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithOneofWKTs adds flags to select fields in MessageWithOneofWKTs. -func AddSetFlagsForMessageWithOneofWKTs(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewFloat64Flag(flagsplugin.Prefix("value.double-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewFloat32Flag(flagsplugin.Prefix("value.float-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt32Flag(flagsplugin.Prefix("value.int32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewInt64Flag(flagsplugin.Prefix("value.int64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint32Flag(flagsplugin.Prefix("value.uint32-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewUint64Flag(flagsplugin.Prefix("value.uint64-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("value.bool-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("value.string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("value.bytes-value", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping EmptyValue because this WKT is currently not supported. - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("value.timestamp-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("value.duration-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringSliceFlag(flagsplugin.Prefix("value.field-mask-value", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping ValueValue because this WKT is currently not supported. - // FIXME: Skipping ListValueValue because this WKT is currently not supported. - // FIXME: Skipping StructValue because this WKT is currently not supported. - // FIXME: Skipping AnyValue because this WKT is currently not supported. -} - -// SetFromFlags sets the MessageWithOneofWKTs message from flags. -func (m *MessageWithOneofWKTs) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetFloat64(flags, flagsplugin.Prefix("value.double_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_DoubleValue{} - ov.DoubleValue = &types.DoubleValue{Value: val} - paths = append(paths, flagsplugin.Prefix("value.double_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetFloat32(flags, flagsplugin.Prefix("value.float_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_FloatValue{} - ov.FloatValue = &types.FloatValue{Value: val} - paths = append(paths, flagsplugin.Prefix("value.float_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt32(flags, flagsplugin.Prefix("value.int32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_Int32Value{} - ov.Int32Value = &types.Int32Value{Value: val} - paths = append(paths, flagsplugin.Prefix("value.int32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetInt64(flags, flagsplugin.Prefix("value.int64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_Int64Value{} - ov.Int64Value = &types.Int64Value{Value: val} - paths = append(paths, flagsplugin.Prefix("value.int64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint32(flags, flagsplugin.Prefix("value.uint32_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_Uint32Value{} - ov.Uint32Value = &types.UInt32Value{Value: val} - paths = append(paths, flagsplugin.Prefix("value.uint32_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetUint64(flags, flagsplugin.Prefix("value.uint64_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_Uint64Value{} - ov.Uint64Value = &types.UInt64Value{Value: val} - paths = append(paths, flagsplugin.Prefix("value.uint64_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("value.bool_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_BoolValue{} - ov.BoolValue = &types.BoolValue{Value: val} - paths = append(paths, flagsplugin.Prefix("value.bool_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("value.string_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_StringValue{} - ov.StringValue = &types.StringValue{Value: val} - paths = append(paths, flagsplugin.Prefix("value.string_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("value.bytes_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_BytesValue{} - ov.BytesValue = &types.BytesValue{Value: val} - paths = append(paths, flagsplugin.Prefix("value.bytes_value", prefix)) - m.Value = ov - } - // FIXME: Skipping EmptyValue because this WKT is not supported. - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("value.timestamp_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_TimestampValue{} - ov.TimestampValue = gogo.SetTimestamp(val) - paths = append(paths, flagsplugin.Prefix("value.timestamp_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("value.duration_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_DurationValue{} - ov.DurationValue = gogo.SetDuration(val) - paths = append(paths, flagsplugin.Prefix("value.duration_value", prefix)) - m.Value = ov - } - if val, changed, err := flagsplugin.GetStringSlice(flags, flagsplugin.Prefix("value.field_mask_value", prefix)); err != nil { - return nil, err - } else if changed { - ov := &MessageWithOneofWKTs_FieldMaskValue{} - ov.FieldMaskValue = gogo.SetFieldMask(val) - paths = append(paths, flagsplugin.Prefix("value.field_mask_value", prefix)) - m.Value = ov - } - // FIXME: Skipping ValueValue because this WKT is not supported. - // FIXME: Skipping ListValueValue because this WKT is not supported. - // FIXME: Skipping StructValue because this WKT is not supported. - // FIXME: Skipping AnyValue because this WKT is not supported. - return paths, nil -} - -// AddSelectFlagsForMessageWithWKTMaps adds flags to select fields in MessageWithWKTMaps. -func AddSelectFlagsForMessageWithWKTMaps(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-double-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-double-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-float-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-float-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-int32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-int32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-int64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-int64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-uint32-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-uint32-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-uint64-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-uint64-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-bool-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-bool-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-string-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-string-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-bytes-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-bytes-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-empty-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-empty-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-timestamp-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-timestamp-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-duration-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-duration-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-field-mask-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-field-mask-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-value-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-value-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-list-value-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-list-value-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-struct-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-struct-map", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-any-map", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-any-map", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithWKTMaps message from select flags. -func PathsFromSelectFlagsForMessageWithWKTMaps(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_double_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_double_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_float_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_float_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_int32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_int32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_int64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_int64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_uint32_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_uint32_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_uint64_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_uint64_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_bool_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_bool_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_string_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_string_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_bytes_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_bytes_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_empty_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_empty_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_timestamp_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_timestamp_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_duration_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_duration_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_field_mask_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_field_mask_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_value_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_value_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_list_value_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_list_value_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_struct_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_struct_map", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_any_map", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_any_map", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithWKTMaps adds flags to select fields in MessageWithWKTMaps. -func AddSetFlagsForMessageWithWKTMaps(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFloat64MapFlag(flagsplugin.Prefix("string-double-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFloat32MapFlag(flagsplugin.Prefix("string-float-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringInt32MapFlag(flagsplugin.Prefix("string-int32-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringInt64MapFlag(flagsplugin.Prefix("string-int64-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringUint32MapFlag(flagsplugin.Prefix("string-uint32-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringUint64MapFlag(flagsplugin.Prefix("string-uint64-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringBoolMapFlag(flagsplugin.Prefix("string-bool-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringStringMapFlag(flagsplugin.Prefix("string-string-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringBytesMapFlag(flagsplugin.Prefix("string-bytes-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping StringEmptyMap because maps with message value types are currently not supported. - flags.AddFlag(flagsplugin.NewStringTimestampMapFlag(flagsplugin.Prefix("string-timestamp-map", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringDurationMapFlag(flagsplugin.Prefix("string-duration-map", prefix), "", flagsplugin.WithHidden(hidden))) - // FIXME: Skipping StringFieldMaskMap because maps with message value types are currently not supported. - // FIXME: Skipping StringValueMap because maps with message value types are currently not supported. - // FIXME: Skipping StringListValueMap because maps with message value types are currently not supported. - // FIXME: Skipping StringStructMap because maps with message value types are currently not supported. - // FIXME: Skipping StringAnyMap because maps with message value types are currently not supported. -} - -// SetFromFlags sets the MessageWithWKTMaps message from flags. -func (m *MessageWithWKTMaps) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetStringFloat64Map(flags, flagsplugin.Prefix("string_double_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringDoubleMap = make(map[string]*types.DoubleValue) - for key, value := range val { - m.StringDoubleMap[key] = &types.DoubleValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_double_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringFloat32Map(flags, flagsplugin.Prefix("string_float_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringFloatMap = make(map[string]*types.FloatValue) - for key, value := range val { - m.StringFloatMap[key] = &types.FloatValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_float_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringInt32Map(flags, flagsplugin.Prefix("string_int32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringInt32Map = make(map[string]*types.Int32Value) - for key, value := range val { - m.StringInt32Map[key] = &types.Int32Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_int32_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringInt64Map(flags, flagsplugin.Prefix("string_int64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringInt64Map = make(map[string]*types.Int64Value) - for key, value := range val { - m.StringInt64Map[key] = &types.Int64Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_int64_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringUint32Map(flags, flagsplugin.Prefix("string_uint32_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringUint32Map = make(map[string]*types.UInt32Value) - for key, value := range val { - m.StringUint32Map[key] = &types.UInt32Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_uint32_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringUint64Map(flags, flagsplugin.Prefix("string_uint64_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringUint64Map = make(map[string]*types.UInt64Value) - for key, value := range val { - m.StringUint64Map[key] = &types.UInt64Value{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_uint64_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringBoolMap(flags, flagsplugin.Prefix("string_bool_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringBoolMap = make(map[string]*types.BoolValue) - for key, value := range val { - m.StringBoolMap[key] = &types.BoolValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_bool_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringStringMap(flags, flagsplugin.Prefix("string_string_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringStringMap = make(map[string]*types.StringValue) - for key, value := range val { - m.StringStringMap[key] = &types.StringValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_string_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringBytesMap(flags, flagsplugin.Prefix("string_bytes_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringBytesMap = make(map[string]*types.BytesValue) - for key, value := range val { - m.StringBytesMap[key] = &types.BytesValue{Value: value} - } - paths = append(paths, flagsplugin.Prefix("string_bytes_map", prefix)) - } - // FIXME: Skipping StringEmptyMap because maps with message value types are currently not supported. - if val, changed, err := flagsplugin.GetStringTimestampMap(flags, flagsplugin.Prefix("string_timestamp_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringTimestampMap = make(map[string]*types.Timestamp) - for key, value := range val { - m.StringTimestampMap[key] = gogo.SetTimestamp(value) - } - paths = append(paths, flagsplugin.Prefix("string_timestamp_map", prefix)) - } - if val, changed, err := flagsplugin.GetStringDurationMap(flags, flagsplugin.Prefix("string_duration_map", prefix)); err != nil { - return nil, err - } else if changed { - m.StringDurationMap = make(map[string]*types.Duration) - for key, value := range val { - m.StringDurationMap[key] = gogo.SetDuration(value) - } - paths = append(paths, flagsplugin.Prefix("string_duration_map", prefix)) - } - // FIXME: Skipping StringFieldMaskMap because maps with message value types are currently not supported. - // FIXME: Skipping StringValueMap because maps with message value types are currently not supported. - // FIXME: Skipping StringListValueMap because maps with message value types are currently not supported. - // FIXME: Skipping StringStructMap because maps with message value types are currently not supported. - // FIXME: Skipping StringAnyMap because maps with message value types are currently not supported. - return paths, nil -} diff --git a/test/gogo/wkts_test.go b/test/gogo/wkts_test.go deleted file mode 100644 index d91abed..0000000 --- a/test/gogo/wkts_test.go +++ /dev/null @@ -1,306 +0,0 @@ -package test_test - -import ( - fmt "fmt" - "strings" - "testing" - time "time" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/gogo" - "github.com/gogo/protobuf/types" - pflag "github.com/spf13/pflag" -) - -var ( - now = time.Now() - testDuration = time.Hour + 2*time.Minute + 3*time.Second + 123456789 -) - -var testMessagesWithWKTs = []struct { - name string - arguments []string - expectedMessage MessageWithWKTs - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithWKTs{}, - expectedMask: nil, - }, - { - name: "single-values", - arguments: []string{ - "--double-value", "432.1423412", - "--float-value", "23.324132", - "--int32-value", "32142", - "--int64-value", "32142", - "--uint32-value", "32142", - "--uint64-value", "32142", - "--bool-value", - "--string-value", "abc123", - "--bytes-value", "abc123", - "--timestamp-value", now.Format(time.RFC3339Nano), - "--duration-value", "3723.123456789s", - "--field-mask-value", "a.b.c,double-value.value,float-value.value", - }, - expectedMessage: MessageWithWKTs{ - DoubleValue: &types.DoubleValue{Value: 432.1423412}, - FloatValue: &types.FloatValue{Value: 23.324132}, - Int32Value: &types.Int32Value{Value: 32142}, - Int64Value: &types.Int64Value{Value: 32142}, - Uint32Value: &types.UInt32Value{Value: 32142}, - Uint64Value: &types.UInt64Value{Value: 32142}, - BoolValue: &types.BoolValue{Value: true}, - StringValue: &types.StringValue{Value: "abc123"}, - BytesValue: &types.BytesValue{Value: getBytesValue("abc123")}, - TimestampValue: getTimestampProto(now), - DurationValue: types.DurationProto(testDuration), - FieldMaskValue: &types.FieldMask{Paths: []string{"a.b.c", "double-value.value", "float-value.value"}}, - }, - expectedMask: []string{ - "double_value", - "float_value", - "int32_value", - "int64_value", - "uint32_value", - "uint64_value", - "bool_value", - "string_value", - "bytes_value", - "timestamp_value", - "duration_value", - "field_mask_value", - }, - }, - { - name: "slice-values", - arguments: []string{ - "--double-values", "432.1423412,43,3123", - "--float-values", "23.324132,43,3123", - "--int32-values", "32142,43,3123", - "--int64-values", "32142,43,3123", - "--uint32-values", "32142,43,3123", - "--uint64-values", "32142,43,3123", - "--bool-values", "true,true,false", - "--string-values", "abc123,abc321,abc123", - "--bytes-values", "AQIDBAUGBwg=,AQIDBAUGBwg=", - "--timestamp-values", now.Format(time.RFC3339Nano), - "--timestamp-values", now.Add(testDuration).Format(time.RFC3339Nano), - "--duration-values", strings.Join([]string{"3723.123456789s", "3723.123456780s", "3723.123456700s"}, ","), - }, - expectedMessage: MessageWithWKTs{ - DoubleValues: []*types.DoubleValue{{Value: 432.1423412}, {Value: 43}, {Value: 3123}}, - FloatValues: []*types.FloatValue{{Value: 23.324132}, {Value: 43}, {Value: 3123}}, - Int32Values: []*types.Int32Value{{Value: 32142}, {Value: 43}, {Value: 3123}}, - Int64Values: []*types.Int64Value{{Value: 32142}, {Value: 43}, {Value: 3123}}, - Uint32Values: []*types.UInt32Value{{Value: 32142}, {Value: 43}, {Value: 3123}}, - Uint64Values: []*types.UInt64Value{{Value: 32142}, {Value: 43}, {Value: 3123}}, - BoolValues: []*types.BoolValue{{Value: true}, {Value: true}, {Value: false}}, - StringValues: []*types.StringValue{ - {Value: "abc123"}, - {Value: "abc321"}, - {Value: "abc123"}, - }, - BytesValues: []*types.BytesValue{ - {Value: []byte{1, 2, 3, 4, 5, 6, 7, 8}}, - {Value: []byte{1, 2, 3, 4, 5, 6, 7, 8}}, - }, - TimestampValues: []*types.Timestamp{ - getTimestampProto(now), - getTimestampProto(now.Add(testDuration)), - }, - DurationValues: []*types.Duration{ - types.DurationProto(testDuration), - types.DurationProto(testDuration.Truncate(10)), - types.DurationProto(testDuration.Truncate(100)), - }, - }, - expectedMask: []string{ - "double_values", - "float_values", - "int32_values", - "int64_values", - "uint32_values", - "uint64_values", - "bool_values", - "string_values", - "bytes_values", - "timestamp_values", - "duration_values", - }, - }, -} - -var testMessagesWithOneofWKTs = []struct { - name string - arguments []string - expectedMessage MessageWithOneofWKTs - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithOneofWKTs{}, - expectedMask: nil, - }, - { - name: "single-values", - arguments: []string{ - "--value.double-value", "432.1423412", - "--value.float-value", "23.324132", - "--value.int32-value", "32142", - "--value.int64-value", "32142", - "--value.uint32-value", "32142", - "--value.uint64-value", "32142", - "--value.bool-value", - "--value.string-value", "abc123", - "--value.bytes-value", "abc123", - "--value.timestamp-value", now.Format(time.RFC3339Nano), - "--value.duration-value", "3723.123456789s", - "--value.field-mask-value", "a.b.c,double-value.value,float-value.value", - }, - expectedMessage: MessageWithOneofWKTs{ - Value: &MessageWithOneofWKTs_FieldMaskValue{ - &types.FieldMask{Paths: []string{"a.b.c", "double-value.value", "float-value.value"}}, - }, - }, - expectedMask: []string{ - "value.double_value", - "value.float_value", - "value.int32_value", - "value.int64_value", - "value.uint32_value", - "value.uint64_value", - "value.bool_value", - "value.string_value", - "value.bytes_value", - "value.timestamp_value", - "value.duration_value", - "value.field_mask_value", - }, - }, -} - -var testMessagesWithWKTMaps = []struct { - name string - arguments []string - expectedMessage MessageWithWKTMaps - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithWKTMaps{}, - expectedMask: nil, - }, - { - name: "single-values", - arguments: []string{ - "--string-double-map", "foo=432.1423412,bar=231.12", - "--string-float-map", "foo=432.1423412,bar=231.12", - "--string-int32-map", "foo=1,bar=-2", - "--string-int64-map", "foo=1,bar=-2", - "--string-uint32-map", "foo=1,bar=2", - "--string-uint64-map", "foo=1,bar=2", - "--string-bool-map", "foo=true,bar=false", - "--string-string-map", "foo=bar,bar=baz", - "--string-bytes-map", "foo=AQIDBAUGBwg=,bar=AQIDBAUGBwg=", - "--string-timestamp-map", fmt.Sprintf("foo=%s,bar=%s", now.Format(time.RFC3339Nano), now.Add(testDuration).Format(time.RFC3339Nano)), - "--string-duration-map", "foo=3723.123456789s,bar=3723.123456780s", - }, - expectedMessage: MessageWithWKTMaps{ - StringDoubleMap: map[string]*types.DoubleValue{ - "foo": {Value: 432.1423412}, - "bar": {Value: 231.12}, - }, - StringFloatMap: map[string]*types.FloatValue{ - "foo": {Value: 432.1423412}, - "bar": {Value: 231.12}, - }, - StringInt32Map: map[string]*types.Int32Value{ - "foo": {Value: 1}, "bar": {Value: -2}, - }, - StringInt64Map: map[string]*types.Int64Value{ - "foo": {Value: 1}, "bar": {Value: -2}, - }, - StringUint32Map: map[string]*types.UInt32Value{ - "foo": {Value: 1}, "bar": {Value: 2}, - }, - StringUint64Map: map[string]*types.UInt64Value{ - "foo": {Value: 1}, "bar": {Value: 2}, - }, - StringBoolMap: map[string]*types.BoolValue{ - "foo": {Value: true}, - "bar": {Value: false}, - }, - StringStringMap: map[string]*types.StringValue{ - "foo": {Value: "bar"}, - "bar": {Value: "baz"}, - }, - StringBytesMap: map[string]*types.BytesValue{ - "foo": {Value: []byte{1, 2, 3, 4, 5, 6, 7, 8}}, - "bar": {Value: []byte{1, 2, 3, 4, 5, 6, 7, 8}}, - }, - StringTimestampMap: map[string]*types.Timestamp{ - "foo": getTimestampProto(now), - "bar": getTimestampProto(now.Add(testDuration)), - }, - StringDurationMap: map[string]*types.Duration{ - "foo": types.DurationProto(testDuration), - "bar": types.DurationProto(testDuration.Truncate(10)), - }, - }, - expectedMask: []string{ - "string_double_map", - "string_float_map", - "string_int32_map", - "string_int64_map", - "string_uint32_map", - "string_uint64_map", - "string_bool_map", - "string_string_map", - "string_bytes_map", - "string_timestamp_map", - "string_duration_map", - }, - }, -} - -func getTimestampProto(t time.Time) *types.Timestamp { - timestamp, err := types.TimestampProto(t) - if err != nil { - return nil - } - return timestamp -} - -func TestSetFlagsMessageWithWKTs(t *testing.T) { - for _, tt := range testMessagesWithWKTs { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithWKTs(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithOneofWKTs(t *testing.T) { - for _, tt := range testMessagesWithOneofWKTs { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithOneofWKTs(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithWKTMaps(t *testing.T) { - for _, tt := range testMessagesWithWKTMaps { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithWKTMaps(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/golang/enums.pb.go b/test/golang/enums.pb.go index 63f435e..47bb264 100644 --- a/test/golang/enums.pb.go +++ b/test/golang/enums.pb.go @@ -11,7 +11,6 @@ package test import ( _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - _ "github.com/gogo/protobuf/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -123,55 +122,6 @@ func (CustomEnum) EnumDescriptor() ([]byte, []int) { return file_enums_proto_rawDescGZIP(), []int{1} } -type MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum int32 - -const ( - MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_AT_MOST_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 0 - MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_AT_LEAST_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 1 - MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EXACTLY_ONCE MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum = 2 -) - -// Enum value maps for MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum. -var ( - MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_name = map[int32]string{ - 0: "AT_MOST_ONCE", - 1: "AT_LEAST_ONCE", - 2: "EXACTLY_ONCE", - } - MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value = map[string]int32{ - "AT_MOST_ONCE": 0, - "AT_LEAST_ONCE": 1, - "EXACTLY_ONCE": 2, - } -) - -func (x MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) Enum() *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum { - p := new(MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) - *p = x - return p -} - -func (x MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) Descriptor() protoreflect.EnumDescriptor { - return file_enums_proto_enumTypes[2].Descriptor() -} - -func (MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) Type() protoreflect.EnumType { - return &file_enums_proto_enumTypes[2] -} - -func (x MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum.Descriptor instead. -func (MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum) EnumDescriptor() ([]byte, []int) { - return file_enums_proto_rawDescGZIP(), []int{3, 0, 0} -} - type CustomEnumValue struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -401,237 +351,79 @@ func (*MessageWithOneofEnums_Custom) isMessageWithOneofEnums_Value() {} func (*MessageWithOneofEnums_WrappedCustom) isMessageWithOneofEnums_Value() {} -type MessageWithEmbeddedMessageDefinitionWithEnums struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - TestMessageField *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum `protobuf:"bytes,1,opt,name=test_message_field,json=testMessageField,proto3" json:"test_message_field,omitempty"` -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums) Reset() { - *x = MessageWithEmbeddedMessageDefinitionWithEnums{} - if protoimpl.UnsafeEnabled { - mi := &file_enums_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithEmbeddedMessageDefinitionWithEnums) ProtoMessage() {} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums) ProtoReflect() protoreflect.Message { - mi := &file_enums_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithEmbeddedMessageDefinitionWithEnums.ProtoReflect.Descriptor instead. -func (*MessageWithEmbeddedMessageDefinitionWithEnums) Descriptor() ([]byte, []int) { - return file_enums_proto_rawDescGZIP(), []int{3} -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums) GetTestMessageField() *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum { - if x != nil { - return x.TestMessageField - } - return nil -} - -type MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - StringValue string `protobuf:"bytes,1,opt,name=string_value,json=stringValue,proto3" json:"string_value,omitempty"` - TestEnumValue MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum `protobuf:"varint,2,opt,name=test_enum_value,json=testEnumValue,proto3,enum=thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum" json:"test_enum_value,omitempty"` - TestAnotherEnumValue MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum `protobuf:"varint,3,opt,name=test_another_enum_value,json=testAnotherEnumValue,proto3,enum=thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum" json:"test_another_enum_value,omitempty"` -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) Reset() { - *x = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum{} - if protoimpl.UnsafeEnabled { - mi := &file_enums_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) ProtoMessage() { -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) ProtoReflect() protoreflect.Message { - mi := &file_enums_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum.ProtoReflect.Descriptor instead. -func (*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) Descriptor() ([]byte, []int) { - return file_enums_proto_rawDescGZIP(), []int{3, 0} -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetStringValue() string { - if x != nil { - return x.StringValue - } - return "" -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetTestEnumValue() MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum { - if x != nil { - return x.TestEnumValue - } - return MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_AT_MOST_ONCE -} - -func (x *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) GetTestAnotherEnumValue() MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum { - if x != nil { - return x.TestAnotherEnumValue - } - return MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_AT_MOST_ONCE -} - var File_enums_proto protoreflect.FileDescriptor var file_enums_proto_rawDesc = []byte{ 0x0a, 0x0b, 0x65, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, - 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, - 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x0a, 0xf2, 0xaa, 0x19, 0x06, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x22, 0xac, 0x03, 0x0a, - 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, - 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, - 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3d, - 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0e, - 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, - 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x38, 0x0a, - 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, - 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x3a, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x55, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x73, 0x12, 0x4c, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x68, + 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x0a, 0xf2, 0xaa, 0x19, 0x06, 0x08, 0x01, 0x10, 0x01, 0x18, 0x01, 0x22, 0xac, 0x03, + 0x0a, 0x10, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, + 0x6d, 0x73, 0x12, 0x3b, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, + 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, + 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, + 0x3d, 0x0a, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0e, 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, + 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, + 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x08, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x73, 0x12, 0x38, + 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, + 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, + 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x3a, 0x0a, 0x07, 0x63, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x07, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x73, 0x12, 0x4c, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, + 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, + 0x6c, 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x12, 0x4e, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, - 0x75, 0x65, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x12, 0x4e, 0x0a, 0x0f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x73, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0xf5, 0x01, 0x0a, 0x15, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, 0x66, - 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, 0x65, - 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, 0x67, - 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x12, 0x4e, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x48, - 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x22, 0xbc, 0x05, 0x0a, 0x2d, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, - 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x93, 0x01, 0x0a, 0x12, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x65, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, - 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, - 0x6e, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x10, 0x74, 0x65, 0x73, 0x74, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x1a, 0xea, 0x03, 0x0a, 0x21, - 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, - 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, - 0x6d, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x61, 0x6c, 0x75, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, - 0x61, 0x6c, 0x75, 0x65, 0x12, 0x9a, 0x01, 0x0a, 0x0f, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x65, 0x6e, - 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x72, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, - 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, - 0x75, 0x6d, 0x73, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, 0x69, 0x74, - 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x6e, - 0x75, 0x6d, 0x52, 0x0d, 0x74, 0x65, 0x73, 0x74, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, - 0x65, 0x12, 0xa9, 0x01, 0x0a, 0x17, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x61, 0x6e, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x5f, 0x65, 0x6e, 0x75, 0x6d, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x72, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, - 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x57, - 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, - 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x44, 0x65, 0x66, 0x69, 0x6e, 0x69, 0x74, 0x69, - 0x6f, 0x6e, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6e, 0x75, 0x6d, 0x2e, 0x45, 0x6d, 0x62, 0x65, 0x64, - 0x64, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x52, 0x14, 0x74, 0x65, 0x73, 0x74, 0x41, 0x6e, 0x6f, - 0x74, 0x68, 0x65, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x4f, 0x0a, - 0x0c, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x10, 0x0a, - 0x0c, 0x41, 0x54, 0x5f, 0x4d, 0x4f, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x43, 0x45, 0x10, 0x00, 0x12, - 0x11, 0x0a, 0x0d, 0x41, 0x54, 0x5f, 0x4c, 0x45, 0x41, 0x53, 0x54, 0x5f, 0x4f, 0x4e, 0x43, 0x45, - 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x58, 0x41, 0x43, 0x54, 0x4c, 0x59, 0x5f, 0x4f, 0x4e, - 0x43, 0x45, 0x10, 0x02, 0x1a, 0x08, 0x88, 0xa3, 0x1e, 0x00, 0xb0, 0xa4, 0x1e, 0x00, 0x3a, 0x08, - 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, - 0x10, 0x01, 0x2a, 0x4a, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, - 0x6d, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, 0x4e, 0x4b, - 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, - 0x52, 0x5f, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, - 0x5f, 0x42, 0x10, 0x02, 0x1a, 0x08, 0x88, 0xa3, 0x1e, 0x00, 0xb0, 0xa4, 0x1e, 0x00, 0x2a, 0x9f, - 0x01, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, - 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, - 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, - 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, - 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x59, 0xf2, 0xaa, 0x19, 0x55, 0x0a, 0x53, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x65, 0x6e, 0x75, 0x6d, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x45, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x42, 0x41, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, - 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, - 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0xf0, 0xe2, 0x1e, 0x01, 0xe8, - 0xe2, 0x1e, 0x00, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x52, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x73, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0xf5, 0x01, 0x0a, + 0x15, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4f, 0x6e, 0x65, 0x6f, + 0x66, 0x45, 0x6e, 0x75, 0x6d, 0x73, 0x12, 0x3d, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, + 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, + 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x52, + 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x07, 0x72, 0x65, + 0x67, 0x75, 0x6c, 0x61, 0x72, 0x12, 0x3a, 0x0a, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x48, 0x00, 0x52, 0x06, 0x63, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x12, 0x4e, 0x0a, 0x0e, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x5f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x74, 0x68, 0x65, 0x74, + 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x48, 0x00, 0x52, 0x0d, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x64, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x2a, 0x40, 0x0a, 0x0b, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x45, + 0x6e, 0x75, 0x6d, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x47, 0x55, 0x4c, 0x41, 0x52, 0x5f, 0x55, + 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, + 0x4c, 0x41, 0x52, 0x5f, 0x41, 0x10, 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x47, 0x55, 0x4c, + 0x41, 0x52, 0x5f, 0x42, 0x10, 0x02, 0x2a, 0x9f, 0x01, 0x0a, 0x0a, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x55, 0x53, 0x54, 0x4f, 0x4d, 0x5f, + 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x43, 0x55, 0x53, + 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x43, 0x55, + 0x53, 0x54, 0x4f, 0x4d, 0x5f, 0x56, 0x31, 0x5f, 0x30, 0x5f, 0x31, 0x10, 0x02, 0x1a, 0x59, 0xf2, + 0xaa, 0x19, 0x55, 0x0a, 0x53, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, + 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, + 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, + 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x65, 0x6e, 0x75, + 0x6d, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x45, 0x6e, 0x75, 0x6d, 0x5f, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, + 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, + 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -646,17 +438,14 @@ func file_enums_proto_rawDescGZIP() []byte { return file_enums_proto_rawDescData } -var file_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_enums_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_enums_proto_enumTypes = make([]protoimpl.EnumInfo, 2) +var file_enums_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_enums_proto_goTypes = []interface{}{ - (RegularEnum)(0), // 0: thethings.flags.test.RegularEnum - (CustomEnum)(0), // 1: thethings.flags.test.CustomEnum - (MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum)(0), // 2: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum.EmbeddedEnum - (*CustomEnumValue)(nil), // 3: thethings.flags.test.CustomEnumValue - (*MessageWithEnums)(nil), // 4: thethings.flags.test.MessageWithEnums - (*MessageWithOneofEnums)(nil), // 5: thethings.flags.test.MessageWithOneofEnums - (*MessageWithEmbeddedMessageDefinitionWithEnums)(nil), // 6: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums - (*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum)(nil), // 7: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum + (RegularEnum)(0), // 0: thethings.flags.test.RegularEnum + (CustomEnum)(0), // 1: thethings.flags.test.CustomEnum + (*CustomEnumValue)(nil), // 2: thethings.flags.test.CustomEnumValue + (*MessageWithEnums)(nil), // 3: thethings.flags.test.MessageWithEnums + (*MessageWithOneofEnums)(nil), // 4: thethings.flags.test.MessageWithOneofEnums } var file_enums_proto_depIdxs = []int32{ 1, // 0: thethings.flags.test.CustomEnumValue.value:type_name -> thethings.flags.test.CustomEnum @@ -664,19 +453,16 @@ var file_enums_proto_depIdxs = []int32{ 0, // 2: thethings.flags.test.MessageWithEnums.regulars:type_name -> thethings.flags.test.RegularEnum 1, // 3: thethings.flags.test.MessageWithEnums.custom:type_name -> thethings.flags.test.CustomEnum 1, // 4: thethings.flags.test.MessageWithEnums.customs:type_name -> thethings.flags.test.CustomEnum - 3, // 5: thethings.flags.test.MessageWithEnums.wrapped_custom:type_name -> thethings.flags.test.CustomEnumValue - 3, // 6: thethings.flags.test.MessageWithEnums.wrapped_customs:type_name -> thethings.flags.test.CustomEnumValue + 2, // 5: thethings.flags.test.MessageWithEnums.wrapped_custom:type_name -> thethings.flags.test.CustomEnumValue + 2, // 6: thethings.flags.test.MessageWithEnums.wrapped_customs:type_name -> thethings.flags.test.CustomEnumValue 0, // 7: thethings.flags.test.MessageWithOneofEnums.regular:type_name -> thethings.flags.test.RegularEnum 1, // 8: thethings.flags.test.MessageWithOneofEnums.custom:type_name -> thethings.flags.test.CustomEnum - 3, // 9: thethings.flags.test.MessageWithOneofEnums.wrapped_custom:type_name -> thethings.flags.test.CustomEnumValue - 7, // 10: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.test_message_field:type_name -> thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum - 2, // 11: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum.test_enum_value:type_name -> thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum.EmbeddedEnum - 2, // 12: thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum.test_another_enum_value:type_name -> thethings.flags.test.MessageWithEmbeddedMessageDefinitionWithEnums.EmbeddedMessageDefinitionWithEnum.EmbeddedEnum - 13, // [13:13] is the sub-list for method output_type - 13, // [13:13] is the sub-list for method input_type - 13, // [13:13] is the sub-list for extension type_name - 13, // [13:13] is the sub-list for extension extendee - 0, // [0:13] is the sub-list for field type_name + 2, // 9: thethings.flags.test.MessageWithOneofEnums.wrapped_custom:type_name -> thethings.flags.test.CustomEnumValue + 10, // [10:10] is the sub-list for method output_type + 10, // [10:10] is the sub-list for method input_type + 10, // [10:10] is the sub-list for extension type_name + 10, // [10:10] is the sub-list for extension extendee + 0, // [0:10] is the sub-list for field type_name } func init() { file_enums_proto_init() } @@ -721,30 +507,6 @@ func file_enums_proto_init() { return nil } } - file_enums_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithEmbeddedMessageDefinitionWithEnums); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_enums_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } } file_enums_proto_msgTypes[2].OneofWrappers = []interface{}{ (*MessageWithOneofEnums_Regular)(nil), @@ -756,8 +518,8 @@ func file_enums_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_enums_proto_rawDesc, - NumEnums: 3, - NumMessages: 5, + NumEnums: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/test/golang/enums_flags.pb.go b/test/golang/enums_flags.pb.go index 6de5db1..1f801f2 100644 --- a/test/golang/enums_flags.pb.go +++ b/test/golang/enums_flags.pb.go @@ -264,109 +264,3 @@ func (m *MessageWithOneofEnums) SetFromFlags(flags *pflag.FlagSet, prefix string } return paths, nil } - -// AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum. -func AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("string-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("string-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-enum-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-enum-value", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-another-enum-value", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-another-enum-value", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum message from select flags. -func PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_enum_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_enum_value", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_another_enum_value", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_another_enum_value", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum. -func AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("string-value", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("test-enum-value", prefix), flagsplugin.EnumValueDesc(MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("test-another-enum-value", prefix), flagsplugin.EnumValueDesc(MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value), flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum message from flags. -func (m *MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("string_value", prefix)); err != nil { - return nil, err - } else if changed { - m.StringValue = val - paths = append(paths, flagsplugin.Prefix("string_value", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("test_enum_value", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value) - if err != nil { - return nil, err - } - m.TestEnumValue = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("test_enum_value", prefix)) - } - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("test_another_enum_value", prefix)); err != nil { - return nil, err - } else if changed { - enumValue, err := flagsplugin.SetEnumString(val, MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum_value) - if err != nil { - return nil, err - } - m.TestAnotherEnumValue = MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum_EmbeddedEnum(enumValue) - paths = append(paths, flagsplugin.Prefix("test_another_enum_value", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums. -func AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("test-message-field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("test-message-field", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test-message-field", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbeddedMessageDefinitionWithEnums message from select flags. -func PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("test_message_field", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums adds flags to select fields in MessageWithEmbeddedMessageDefinitionWithEnums. -func AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForMessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum(flags, flagsplugin.Prefix("test-message-field", prefix), hidden) -} - -// SetFromFlags sets the MessageWithEmbeddedMessageDefinitionWithEnums message from flags. -func (m *MessageWithEmbeddedMessageDefinitionWithEnums) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("test_message_field", prefix)); changed { - if m.TestMessageField == nil { - m.TestMessageField = &MessageWithEmbeddedMessageDefinitionWithEnums_EmbeddedMessageDefinitionWithEnum{} - } - if setPaths, err := m.TestMessageField.SetFromFlags(flags, flagsplugin.Prefix("test_message_field", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} diff --git a/test/golang/gogo.pb.go b/test/golang/gogo.pb.go deleted file mode 100644 index 8e8153f..0000000 --- a/test/golang/gogo.pb.go +++ /dev/null @@ -1,709 +0,0 @@ -// Copyright © 2021 The Things Industries B.V. -// SPDX-License-Identifier: Apache-2.0 - -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.28.1 -// protoc v3.20.1 -// source: gogo.proto - -package test - -import ( - _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - _ "github.com/gogo/protobuf/gogoproto" - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - durationpb "google.golang.org/protobuf/types/known/durationpb" - timestamppb "google.golang.org/protobuf/types/known/timestamppb" - reflect "reflect" - sync "sync" -) - -const ( - // Verify that this generated code is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion) - // Verify that runtime/protoimpl is sufficiently up-to-date. - _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) -) - -type MessageWithGoGoOptions struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - EuiWithCustomName []byte `protobuf:"bytes,1,opt,name=eui_with_custom_name,json=euiWithCustomName,proto3" json:"eui_with_custom_name,omitempty"` - EuiWithCustomNameAndType []byte `protobuf:"bytes,2,opt,name=eui_with_custom_name_and_type,json=euiWithCustomNameAndType,proto3" json:"eui_with_custom_name_and_type,omitempty"` - NonNullableEuiWithCustomNameAndType []byte `protobuf:"bytes,3,opt,name=non_nullable_eui_with_custom_name_and_type,json=nonNullableEuiWithCustomNameAndType,proto3" json:"non_nullable_eui_with_custom_name_and_type,omitempty"` - EuisWithCustomNameAndType [][]byte `protobuf:"bytes,4,rep,name=euis_with_custom_name_and_type,json=euisWithCustomNameAndType,proto3" json:"euis_with_custom_name_and_type,omitempty"` - Duration *durationpb.Duration `protobuf:"bytes,5,opt,name=duration,proto3" json:"duration,omitempty"` - NonNullableDuration *durationpb.Duration `protobuf:"bytes,6,opt,name=non_nullable_duration,json=nonNullableDuration,proto3" json:"non_nullable_duration,omitempty"` - Timestamp *timestamppb.Timestamp `protobuf:"bytes,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"` - NonNullableTimestamp *timestamppb.Timestamp `protobuf:"bytes,8,opt,name=non_nullable_timestamp,json=nonNullableTimestamp,proto3" json:"non_nullable_timestamp,omitempty"` -} - -func (x *MessageWithGoGoOptions) Reset() { - *x = MessageWithGoGoOptions{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithGoGoOptions) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithGoGoOptions) ProtoMessage() {} - -func (x *MessageWithGoGoOptions) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithGoGoOptions.ProtoReflect.Descriptor instead. -func (*MessageWithGoGoOptions) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{0} -} - -func (x *MessageWithGoGoOptions) GetEuiWithCustomName() []byte { - if x != nil { - return x.EuiWithCustomName - } - return nil -} - -func (x *MessageWithGoGoOptions) GetEuiWithCustomNameAndType() []byte { - if x != nil { - return x.EuiWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableEuiWithCustomNameAndType() []byte { - if x != nil { - return x.NonNullableEuiWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetEuisWithCustomNameAndType() [][]byte { - if x != nil { - return x.EuisWithCustomNameAndType - } - return nil -} - -func (x *MessageWithGoGoOptions) GetDuration() *durationpb.Duration { - if x != nil { - return x.Duration - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableDuration() *durationpb.Duration { - if x != nil { - return x.NonNullableDuration - } - return nil -} - -func (x *MessageWithGoGoOptions) GetTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.Timestamp - } - return nil -} - -func (x *MessageWithGoGoOptions) GetNonNullableTimestamp() *timestamppb.Timestamp { - if x != nil { - return x.NonNullableTimestamp - } - return nil -} - -type SubMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Field string `protobuf:"bytes,1,opt,name=field,proto3" json:"field,omitempty"` -} - -func (x *SubMessage) Reset() { - *x = SubMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubMessage) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubMessage) ProtoMessage() {} - -func (x *SubMessage) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubMessage.ProtoReflect.Descriptor instead. -func (*SubMessage) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{1} -} - -func (x *SubMessage) GetField() string { - if x != nil { - return x.Field - } - return "" -} - -type SubMessageWithoutMarshalers struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - OtherField string `protobuf:"bytes,1,opt,name=other_field,json=otherField,proto3" json:"other_field,omitempty"` -} - -func (x *SubMessageWithoutMarshalers) Reset() { - *x = SubMessageWithoutMarshalers{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SubMessageWithoutMarshalers) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SubMessageWithoutMarshalers) ProtoMessage() {} - -func (x *SubMessageWithoutMarshalers) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use SubMessageWithoutMarshalers.ProtoReflect.Descriptor instead. -func (*SubMessageWithoutMarshalers) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{2} -} - -func (x *SubMessageWithoutMarshalers) GetOtherField() string { - if x != nil { - return x.OtherField - } - return "" -} - -type MessageWithNullable struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - Subs []*SubMessage `protobuf:"bytes,2,rep,name=subs,proto3" json:"subs,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,3,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` - OtherSubs []*SubMessageWithoutMarshalers `protobuf:"bytes,4,rep,name=other_subs,json=otherSubs,proto3" json:"other_subs,omitempty"` -} - -func (x *MessageWithNullable) Reset() { - *x = MessageWithNullable{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithNullable) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithNullable) ProtoMessage() {} - -func (x *MessageWithNullable) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithNullable.ProtoReflect.Descriptor instead. -func (*MessageWithNullable) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{3} -} - -func (x *MessageWithNullable) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithNullable) GetSubs() []*SubMessage { - if x != nil { - return x.Subs - } - return nil -} - -func (x *MessageWithNullable) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -func (x *MessageWithNullable) GetOtherSubs() []*SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSubs - } - return nil -} - -type MessageWithEmbedded struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` -} - -func (x *MessageWithEmbedded) Reset() { - *x = MessageWithEmbedded{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithEmbedded) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithEmbedded) ProtoMessage() {} - -func (x *MessageWithEmbedded) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithEmbedded.ProtoReflect.Descriptor instead. -func (*MessageWithEmbedded) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{4} -} - -func (x *MessageWithEmbedded) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -type MessageWithNullableEmbedded struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Sub *SubMessage `protobuf:"bytes,1,opt,name=sub,proto3" json:"sub,omitempty"` - OtherSub *SubMessageWithoutMarshalers `protobuf:"bytes,2,opt,name=other_sub,json=otherSub,proto3" json:"other_sub,omitempty"` -} - -func (x *MessageWithNullableEmbedded) Reset() { - *x = MessageWithNullableEmbedded{} - if protoimpl.UnsafeEnabled { - mi := &file_gogo_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *MessageWithNullableEmbedded) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*MessageWithNullableEmbedded) ProtoMessage() {} - -func (x *MessageWithNullableEmbedded) ProtoReflect() protoreflect.Message { - mi := &file_gogo_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - if ms.LoadMessageInfo() == nil { - ms.StoreMessageInfo(mi) - } - return ms - } - return mi.MessageOf(x) -} - -// Deprecated: Use MessageWithNullableEmbedded.ProtoReflect.Descriptor instead. -func (*MessageWithNullableEmbedded) Descriptor() ([]byte, []int) { - return file_gogo_proto_rawDescGZIP(), []int{5} -} - -func (x *MessageWithNullableEmbedded) GetSub() *SubMessage { - if x != nil { - return x.Sub - } - return nil -} - -func (x *MessageWithNullableEmbedded) GetOtherSub() *SubMessageWithoutMarshalers { - if x != nil { - return x.OtherSub - } - return nil -} - -var File_gogo_proto protoreflect.FileDescriptor - -var file_gogo_proto_rawDesc = []byte{ - 0x0a, 0x0a, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, - 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa5, 0x0b, 0x0a, 0x16, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x47, 0x6f, 0x47, 0x6f, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x12, 0x46, 0x0a, 0x14, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x42, 0x15, - 0xe2, 0xde, 0x1f, 0x11, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x52, 0x11, 0x65, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0xc4, 0x02, 0x0a, 0x1d, 0x65, 0x75, 0x69, - 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, - 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, - 0x42, 0x82, 0x02, 0xe2, 0xde, 0x1f, 0x18, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, - 0xde, 0x1f, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xf2, 0xaa, 0x19, 0x9a, 0x01, 0x1a, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x38, 0x42, - 0x79, 0x74, 0x65, 0x73, 0x46, 0x6c, 0x61, 0x67, 0x22, 0x4b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, - 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x18, 0x65, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, - 0xeb, 0x02, 0x0a, 0x2a, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, - 0x5f, 0x65, 0x75, 0x69, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0c, 0x42, 0x91, 0x02, 0xe2, 0xde, 0x1f, 0x23, 0x4e, 0x6f, 0x6e, 0x4e, 0x75, - 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x55, 0x49, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, - 0x1f, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, - 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, - 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, - 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x45, 0x55, 0x49, 0x36, 0x34, 0xc8, 0xde, 0x1f, 0x00, 0xf2, 0xaa, 0x19, 0x9a, 0x01, 0x1a, 0x4b, - 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, - 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x4e, 0x65, - 0x77, 0x38, 0x42, 0x79, 0x74, 0x65, 0x73, 0x46, 0x6c, 0x61, 0x67, 0x22, 0x4b, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, - 0x61, 0x63, 0x74, 0x42, 0x79, 0x74, 0x65, 0x73, 0x52, 0x23, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, - 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x75, 0x69, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0xd1, 0x02, - 0x0a, 0x1e, 0x65, 0x75, 0x69, 0x73, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x63, 0x75, 0x73, 0x74, - 0x6f, 0x6d, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x61, 0x6e, 0x64, 0x5f, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x0c, 0x42, 0x8d, 0x02, 0xe2, 0xde, 0x1f, 0x19, 0x45, 0x55, 0x49, - 0x73, 0x57, 0x69, 0x74, 0x68, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, - 0x6e, 0x64, 0x54, 0x79, 0x70, 0x65, 0xda, 0xde, 0x1f, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, - 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, - 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, - 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x45, 0x55, 0x49, 0x36, 0x34, 0xf2, 0xaa, 0x19, - 0xa4, 0x01, 0x1a, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, - 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, - 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, - 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x4e, 0x65, 0x77, 0x38, 0x42, 0x79, 0x74, 0x65, 0x73, 0x53, 0x6c, 0x69, 0x63, 0x65, - 0x46, 0x6c, 0x61, 0x67, 0x22, 0x50, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, - 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, - 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, - 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x2f, 0x74, 0x79, - 0x70, 0x65, 0x73, 0x2e, 0x47, 0x65, 0x74, 0x45, 0x78, 0x61, 0x63, 0x74, 0x42, 0x79, 0x74, 0x65, - 0x73, 0x53, 0x6c, 0x69, 0x63, 0x65, 0x52, 0x19, 0x65, 0x75, 0x69, 0x73, 0x57, 0x69, 0x74, 0x68, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4e, 0x61, 0x6d, 0x65, 0x41, 0x6e, 0x64, 0x54, 0x79, 0x70, - 0x65, 0x12, 0x3b, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x04, - 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x57, - 0x0a, 0x15, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x64, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, - 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x98, 0xdf, - 0x1f, 0x01, 0x52, 0x13, 0x6e, 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x44, - 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3e, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, - 0x74, 0x61, 0x6d, 0x70, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, - 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x42, 0x04, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x09, 0x74, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x5a, 0x0a, 0x16, 0x6e, 0x6f, 0x6e, 0x5f, 0x6e, - 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, - 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0x90, 0xdf, 0x1f, 0x01, 0x52, 0x14, 0x6e, - 0x6f, 0x6e, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, - 0x61, 0x6d, 0x70, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0x2c, 0x0a, - 0x0a, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x66, - 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x66, 0x69, 0x65, 0x6c, - 0x64, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0x48, 0x0a, 0x1b, 0x53, - 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, - 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x74, - 0x68, 0x65, 0x72, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x3a, 0x08, 0xf2, 0xaa, 0x19, - 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0xc3, 0x02, 0x0a, 0x13, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x12, 0x38, 0x0a, - 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, - 0x1f, 0x00, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x3a, 0x0a, 0x04, 0x73, 0x75, 0x62, 0x73, 0x18, - 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, - 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x04, 0x73, - 0x75, 0x62, 0x73, 0x12, 0x54, 0x0a, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, - 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, - 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, - 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, - 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, 0x12, 0x56, 0x0a, 0x0a, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, - 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, - 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, - 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, 0x73, - 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x53, 0x75, 0x62, - 0x73, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0xaf, 0x01, 0x0a, 0x13, - 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x45, 0x6d, 0x62, 0x65, 0x64, - 0x64, 0x65, 0x64, 0x12, 0x38, 0x0a, 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x54, 0x0a, - 0x09, 0x6f, 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x31, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, - 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, - 0x65, 0x72, 0x73, 0x42, 0x04, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, 0x65, 0x72, - 0x53, 0x75, 0x62, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x22, 0xbf, 0x01, - 0x0a, 0x1b, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x57, 0x69, 0x74, 0x68, 0x4e, 0x75, 0x6c, - 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x45, 0x6d, 0x62, 0x65, 0x64, 0x64, 0x65, 0x64, 0x12, 0x3c, 0x0a, - 0x03, 0x73, 0x75, 0x62, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x74, 0x68, 0x65, - 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, - 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x42, 0x08, 0xc8, 0xde, - 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x03, 0x73, 0x75, 0x62, 0x12, 0x58, 0x0a, 0x09, 0x6f, - 0x74, 0x68, 0x65, 0x72, 0x5f, 0x73, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x31, - 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, - 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x75, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x57, 0x69, 0x74, 0x68, 0x6f, 0x75, 0x74, 0x4d, 0x61, 0x72, 0x73, 0x68, 0x61, 0x6c, 0x65, 0x72, - 0x73, 0x42, 0x08, 0xc8, 0xde, 0x1f, 0x00, 0xd0, 0xde, 0x1f, 0x01, 0x52, 0x08, 0x6f, 0x74, 0x68, - 0x65, 0x72, 0x53, 0x75, 0x62, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x01, 0x10, 0x01, 0x42, - 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, - 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, - 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, - 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x33, -} - -var ( - file_gogo_proto_rawDescOnce sync.Once - file_gogo_proto_rawDescData = file_gogo_proto_rawDesc -) - -func file_gogo_proto_rawDescGZIP() []byte { - file_gogo_proto_rawDescOnce.Do(func() { - file_gogo_proto_rawDescData = protoimpl.X.CompressGZIP(file_gogo_proto_rawDescData) - }) - return file_gogo_proto_rawDescData -} - -var file_gogo_proto_msgTypes = make([]protoimpl.MessageInfo, 6) -var file_gogo_proto_goTypes = []interface{}{ - (*MessageWithGoGoOptions)(nil), // 0: thethings.flags.test.MessageWithGoGoOptions - (*SubMessage)(nil), // 1: thethings.flags.test.SubMessage - (*SubMessageWithoutMarshalers)(nil), // 2: thethings.flags.test.SubMessageWithoutMarshalers - (*MessageWithNullable)(nil), // 3: thethings.flags.test.MessageWithNullable - (*MessageWithEmbedded)(nil), // 4: thethings.flags.test.MessageWithEmbedded - (*MessageWithNullableEmbedded)(nil), // 5: thethings.flags.test.MessageWithNullableEmbedded - (*durationpb.Duration)(nil), // 6: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 7: google.protobuf.Timestamp -} -var file_gogo_proto_depIdxs = []int32{ - 6, // 0: thethings.flags.test.MessageWithGoGoOptions.duration:type_name -> google.protobuf.Duration - 6, // 1: thethings.flags.test.MessageWithGoGoOptions.non_nullable_duration:type_name -> google.protobuf.Duration - 7, // 2: thethings.flags.test.MessageWithGoGoOptions.timestamp:type_name -> google.protobuf.Timestamp - 7, // 3: thethings.flags.test.MessageWithGoGoOptions.non_nullable_timestamp:type_name -> google.protobuf.Timestamp - 1, // 4: thethings.flags.test.MessageWithNullable.sub:type_name -> thethings.flags.test.SubMessage - 1, // 5: thethings.flags.test.MessageWithNullable.subs:type_name -> thethings.flags.test.SubMessage - 2, // 6: thethings.flags.test.MessageWithNullable.other_sub:type_name -> thethings.flags.test.SubMessageWithoutMarshalers - 2, // 7: thethings.flags.test.MessageWithNullable.other_subs:type_name -> thethings.flags.test.SubMessageWithoutMarshalers - 1, // 8: thethings.flags.test.MessageWithEmbedded.sub:type_name -> thethings.flags.test.SubMessage - 2, // 9: thethings.flags.test.MessageWithEmbedded.other_sub:type_name -> thethings.flags.test.SubMessageWithoutMarshalers - 1, // 10: thethings.flags.test.MessageWithNullableEmbedded.sub:type_name -> thethings.flags.test.SubMessage - 2, // 11: thethings.flags.test.MessageWithNullableEmbedded.other_sub:type_name -> thethings.flags.test.SubMessageWithoutMarshalers - 12, // [12:12] is the sub-list for method output_type - 12, // [12:12] is the sub-list for method input_type - 12, // [12:12] is the sub-list for extension type_name - 12, // [12:12] is the sub-list for extension extendee - 0, // [0:12] is the sub-list for field type_name -} - -func init() { file_gogo_proto_init() } -func file_gogo_proto_init() { - if File_gogo_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_gogo_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithGoGoOptions); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SubMessageWithoutMarshalers); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithNullable); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithEmbedded); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_gogo_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MessageWithNullableEmbedded); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } - type x struct{} - out := protoimpl.TypeBuilder{ - File: protoimpl.DescBuilder{ - GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_gogo_proto_rawDesc, - NumEnums: 0, - NumMessages: 6, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_gogo_proto_goTypes, - DependencyIndexes: file_gogo_proto_depIdxs, - MessageInfos: file_gogo_proto_msgTypes, - }.Build() - File_gogo_proto = out.File - file_gogo_proto_rawDesc = nil - file_gogo_proto_goTypes = nil - file_gogo_proto_depIdxs = nil -} diff --git a/test/golang/gogo_flags.pb.go b/test/golang/gogo_flags.pb.go deleted file mode 100644 index 447dfd0..0000000 --- a/test/golang/gogo_flags.pb.go +++ /dev/null @@ -1,406 +0,0 @@ -// Code generated by protoc-gen-go-flags. DO NOT EDIT. -// versions: -// - protoc-gen-go-flags v0.0.0-dev -// - protoc v3.20.1 -// source: gogo.proto - -package test - -import ( - flagsplugin "github.com/TheThingsIndustries/protoc-gen-go-flags/flagsplugin" - golang "github.com/TheThingsIndustries/protoc-gen-go-flags/golang" - types "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types" - pflag "github.com/spf13/pflag" -) - -// AddSelectFlagsForMessageWithGoGoOptions adds flags to select fields in MessageWithGoGoOptions. -func AddSelectFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("eui-with-custom-name", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("eui-with-custom-name", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("duration", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("duration", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-duration", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-duration", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("timestamp", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("timestamp", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("non-nullable-timestamp", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("non-nullable-timestamp", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithGoGoOptions message from select flags. -func PathsFromSelectFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("eui_with_custom_name", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("duration", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("duration", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_duration", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_duration", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("timestamp", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("timestamp", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("non_nullable_timestamp", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("non_nullable_timestamp", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithGoGoOptions adds flags to select fields in MessageWithGoGoOptions. -func AddSetFlagsForMessageWithGoGoOptions(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBytesFlag(flagsplugin.Prefix("eui-with-custom-name", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesFlag(flagsplugin.Prefix("eui-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesFlag(flagsplugin.Prefix("non-nullable-eui-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(types.New8BytesSliceFlag(flagsplugin.Prefix("euis-with-custom-name-and-type", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("duration", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewDurationFlag(flagsplugin.Prefix("non-nullable-duration", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("timestamp", prefix), "", flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewTimestampFlag(flagsplugin.Prefix("non-nullable-timestamp", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the MessageWithGoGoOptions message from flags. -func (m *MessageWithGoGoOptions) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetBytes(flags, flagsplugin.Prefix("eui_with_custom_name", prefix)); err != nil { - return nil, err - } else if changed { - m.EuiWithCustomName = val - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name", prefix)) - } - if val, changed, err := types.GetExactBytes(flags, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.EuiWithCustomNameAndType = val - paths = append(paths, flagsplugin.Prefix("eui_with_custom_name_and_type", prefix)) - } - if val, changed, err := types.GetExactBytes(flags, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableEuiWithCustomNameAndType = val - paths = append(paths, flagsplugin.Prefix("non_nullable_eui_with_custom_name_and_type", prefix)) - } - if val, changed, err := types.GetExactBytesSlice(flags, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)); err != nil { - return nil, err - } else if changed { - m.EuisWithCustomNameAndType = val - paths = append(paths, flagsplugin.Prefix("euis_with_custom_name_and_type", prefix)) - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("duration", prefix)); err != nil { - return nil, err - } else if changed { - m.Duration = golang.SetDuration(val) - paths = append(paths, flagsplugin.Prefix("duration", prefix)) - } - if val, changed, err := flagsplugin.GetDuration(flags, flagsplugin.Prefix("non_nullable_duration", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableDuration = golang.SetDuration(val) - paths = append(paths, flagsplugin.Prefix("non_nullable_duration", prefix)) - } - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("timestamp", prefix)); err != nil { - return nil, err - } else if changed { - m.Timestamp = golang.SetTimestamp(val) - paths = append(paths, flagsplugin.Prefix("timestamp", prefix)) - } - if val, changed, err := flagsplugin.GetTimestamp(flags, flagsplugin.Prefix("non_nullable_timestamp", prefix)); err != nil { - return nil, err - } else if changed { - m.NonNullableTimestamp = golang.SetTimestamp(val) - paths = append(paths, flagsplugin.Prefix("non_nullable_timestamp", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForSubMessage adds flags to select fields in SubMessage. -func AddSelectFlagsForSubMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("field", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forSubMessage message from select flags. -func PathsFromSelectFlagsForSubMessage(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("field", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSubMessage adds flags to select fields in SubMessage. -func AddSetFlagsForSubMessage(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("field", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SubMessage message from flags. -func (m *SubMessage) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("field", prefix)); err != nil { - return nil, err - } else if changed { - m.Field = val - paths = append(paths, flagsplugin.Prefix("field", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForSubMessageWithoutMarshalers adds flags to select fields in SubMessageWithoutMarshalers. -func AddSelectFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-field", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-field", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forSubMessageWithoutMarshalers message from select flags. -func PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_field", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_field", prefix)) - } - return paths, nil -} - -// AddSetFlagsForSubMessageWithoutMarshalers adds flags to select fields in SubMessageWithoutMarshalers. -func AddSetFlagsForSubMessageWithoutMarshalers(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewStringFlag(flagsplugin.Prefix("other-field", prefix), "", flagsplugin.WithHidden(hidden))) -} - -// SetFromFlags sets the SubMessageWithoutMarshalers message from flags. -func (m *SubMessageWithoutMarshalers) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, changed, err := flagsplugin.GetString(flags, flagsplugin.Prefix("other_field", prefix)); err != nil { - return nil, err - } else if changed { - m.OtherField = val - paths = append(paths, flagsplugin.Prefix("other_field", prefix)) - } - return paths, nil -} - -// AddSelectFlagsForMessageWithNullable adds flags to select fields in MessageWithNullable. -func AddSelectFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("subs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("subs", prefix), false), flagsplugin.WithHidden(hidden))) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-subs", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-subs", prefix), false), flagsplugin.WithHidden(hidden))) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithNullable message from select flags. -func PathsFromSelectFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("subs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("subs", prefix)) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_subs", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_subs", prefix)) - } - return paths, nil -} - -// AddSetFlagsForMessageWithNullable adds flags to select fields in MessageWithNullable. -func AddSetFlagsForMessageWithNullable(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - // FIXME: Skipping Subs because repeated messages are currently not supported. - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) - // FIXME: Skipping OtherSubs because repeated messages are currently not supported. -} - -// SetFromFlags sets the MessageWithNullable message from flags. -func (m *MessageWithNullable) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if m.Sub == nil { - m.Sub = &SubMessage{} - } - if setPaths, err := m.Sub.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - // FIXME: Skipping Subs because it does not seem to implement AddSetFlags. - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if m.OtherSub == nil { - m.OtherSub = &SubMessageWithoutMarshalers{} - } - if setPaths, err := m.OtherSub.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - // FIXME: Skipping OtherSubs because it does not seem to implement AddSetFlags. - return paths, nil -} - -// AddSelectFlagsForMessageWithEmbedded adds flags to select fields in MessageWithEmbedded. -func AddSelectFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithEmbedded message from select flags. -func PathsFromSelectFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithEmbedded adds flags to select fields in MessageWithEmbedded. -func AddSetFlagsForMessageWithEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SetFromFlags sets the MessageWithEmbedded message from flags. -func (m *MessageWithEmbedded) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if m.Sub == nil { - m.Sub = &SubMessage{} - } - if setPaths, err := m.Sub.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if m.OtherSub == nil { - m.OtherSub = &SubMessageWithoutMarshalers{} - } - if setPaths, err := m.OtherSub.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} - -// AddSelectFlagsForMessageWithNullableEmbedded adds flags to select fields in MessageWithNullableEmbedded. -func AddSelectFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - flags.AddFlag(flagsplugin.NewBoolFlag(flagsplugin.Prefix("other-sub", prefix), flagsplugin.SelectDesc(flagsplugin.Prefix("other-sub", prefix), true), flagsplugin.WithHidden(hidden))) - AddSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SelectFromFlags outputs the fieldmask paths forMessageWithNullableEmbedded message from select flags. -func PathsFromSelectFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - if val, selected, err := flagsplugin.GetBool(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else if selected && val { - paths = append(paths, flagsplugin.Prefix("other_sub", prefix)) - } - if selectPaths, err := PathsFromSelectFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, selectPaths...) - } - return paths, nil -} - -// AddSetFlagsForMessageWithNullableEmbedded adds flags to select fields in MessageWithNullableEmbedded. -func AddSetFlagsForMessageWithNullableEmbedded(flags *pflag.FlagSet, prefix string, hidden bool) { - AddSetFlagsForSubMessage(flags, flagsplugin.Prefix("sub", prefix), hidden) - AddSetFlagsForSubMessageWithoutMarshalers(flags, flagsplugin.Prefix("other-sub", prefix), hidden) -} - -// SetFromFlags sets the MessageWithNullableEmbedded message from flags. -func (m *MessageWithNullableEmbedded) SetFromFlags(flags *pflag.FlagSet, prefix string) (paths []string, err error) { - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("sub", prefix)); changed { - if m.Sub == nil { - m.Sub = &SubMessage{} - } - if setPaths, err := m.Sub.SetFromFlags(flags, flagsplugin.Prefix("sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - if changed := flagsplugin.IsAnyPrefixSet(flags, flagsplugin.Prefix("other_sub", prefix)); changed { - if m.OtherSub == nil { - m.OtherSub = &SubMessageWithoutMarshalers{} - } - if setPaths, err := m.OtherSub.SetFromFlags(flags, flagsplugin.Prefix("other_sub", prefix)); err != nil { - return nil, err - } else { - paths = append(paths, setPaths...) - } - } - return paths, nil -} diff --git a/test/golang/gogo_test.go b/test/golang/gogo_test.go deleted file mode 100644 index 94590a0..0000000 --- a/test/golang/gogo_test.go +++ /dev/null @@ -1,91 +0,0 @@ -package test_test - -import ( - "encoding/hex" - "testing" - - . "github.com/TheThingsIndustries/protoc-gen-go-flags/test/golang" - types "github.com/TheThingsIndustries/protoc-gen-go-flags/test/types" - pflag "github.com/spf13/pflag" -) - -var testMessagesWithGoGoOptions = []struct { - name string - arguments []string - expectedMessage MessageWithGoGoOptions - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithGoGoOptions{}, - expectedMask: nil, - }, - { - name: "full", - arguments: []string{ - "--eui-with-custom-name", "AQIDBAUGBwg=", - "--eui-with-custom-name-and-type", "0102030405060708", - "--non-nullable-eui-with-custom-name-and-type", "0102030405060708", - "--euis-with-custom-name-and-type", - "0102030405060708,0102030405060707,0102030405060709", - }, - expectedMessage: MessageWithGoGoOptions{ - EuiWithCustomName: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - NonNullableEuiWithCustomNameAndType: []byte{1, 2, 3, 4, 5, 6, 7, 8}, - EuisWithCustomNameAndType: [][]byte{ - {1, 2, 3, 4, 5, 6, 7, 8}, - {1, 2, 3, 4, 5, 6, 7, 7}, - {1, 2, 3, 4, 5, 6, 7, 9}, - }, - }, - expectedMask: []string{ - "eui_with_custom_name", - "eui_with_custom_name_and_type", - "non_nullable_eui_with_custom_name_and_type", - "euis_with_custom_name_and_type", - }, - }, -} - -var testMessagesWithNullable = []struct { - name string - arguments []string - expectedMessage MessageWithNullable - expectedMask []string -}{ - { - name: "empty", - arguments: []string{}, - expectedMessage: MessageWithNullable{}, - expectedMask: nil, - }, -} - -func unmarshalEUI64(s string) *types.EUI64 { - var eui64 types.EUI64 - b, _ := hex.DecodeString(s) - eui64.Unmarshal(b) - return &eui64 -} - -func TestSetFlagsMessageWithGoGoOptions(t *testing.T) { - for _, tt := range testMessagesWithGoGoOptions { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithGoGoOptions(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} - -func TestSetFlagsMessageWithNullable(t *testing.T) { - for _, tt := range testMessagesWithNullable { - t.Run(tt.name, func(t *testing.T) { - fs := &pflag.FlagSet{} - AddSetFlagsForMessageWithNullable(fs, "", false) - expectMessageEqual(t, fs, tt.arguments, &tt.expectedMessage, tt.expectedMask) - }) - } -} diff --git a/test/golang/message.pb.go b/test/golang/message.pb.go index 5702ebe..ea702ab 100644 --- a/test/golang/message.pb.go +++ b/test/golang/message.pb.go @@ -11,7 +11,6 @@ package test import ( _ "github.com/TheThingsIndustries/protoc-gen-go-flags/annotations" - _ "github.com/gogo/protobuf/gogoproto" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" @@ -345,53 +344,51 @@ var file_message_proto_rawDesc = []byte{ 0x0a, 0x0d, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, - 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x53, 0x65, 0x6d, 0x61, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, 0x0a, - 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x74, + 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xdb, 0x02, 0x0a, 0x11, 0x53, 0x65, 0x6d, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x43, + 0x0a, 0x05, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, + 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, + 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, + 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x05, 0x65, 0x6d, + 0x70, 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6f, 0x76, 0x65, + 0x72, 0x72, 0x75, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x05, 0x65, 0x6d, 0x70, - 0x74, 0x79, 0x12, 0x5e, 0x0a, 0x0f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x5f, 0x6f, 0x76, 0x65, 0x72, - 0x72, 0x75, 0x6c, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x06, 0xf2, 0xaa, 0x19, 0x02, - 0x30, 0x00, 0x52, 0x0e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x75, 0x6c, - 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x09, 0x6e, 0x6f, 0x6e, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, + 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x42, 0x06, 0xf2, 0xaa, 0x19, + 0x02, 0x30, 0x00, 0x52, 0x0e, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x75, + 0x6c, 0x65, 0x64, 0x12, 0x4d, 0x0a, 0x09, 0x6e, 0x6f, 0x6e, 0x5f, 0x65, 0x6d, 0x70, 0x74, 0x79, + 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, + 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, + 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, + 0x4e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x08, 0x6e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, + 0x74, 0x79, 0x1a, 0x11, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x08, 0xf2, 0xaa, 0x19, + 0x04, 0x08, 0x00, 0x10, 0x01, 0x1a, 0x33, 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x01, 0x3a, 0x0a, 0xf2, 0xaa, 0x19, 0x06, + 0x08, 0x00, 0x10, 0x01, 0x20, 0x01, 0x22, 0x9d, 0x02, 0x0a, 0x16, 0x53, 0x65, 0x6d, 0x61, 0x6e, + 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, + 0x65, 0x12, 0x54, 0x0a, 0x0a, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, - 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4e, - 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x08, 0x6e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, - 0x79, 0x1a, 0x11, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, - 0x08, 0x00, 0x10, 0x01, 0x1a, 0x33, 0x0a, 0x08, 0x4e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, - 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x01, 0x3a, 0x0a, 0xf2, 0xaa, 0x19, 0x06, 0x08, - 0x00, 0x10, 0x01, 0x20, 0x01, 0x22, 0x9d, 0x02, 0x0a, 0x16, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, - 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x54, 0x0a, 0x0a, 0x73, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x32, 0x2e, 0x74, 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, - 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x6d, 0x61, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x59, 0x0a, 0x0b, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, 0x68, - 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x65, - 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4e, 0x6f, 0x6e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, 0x76, - 0x65, 0x1a, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, 0x0a, 0x08, 0x4e, 0x6f, - 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, 0x76, - 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6c, - 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x01, 0x3a, - 0x0a, 0xf2, 0xaa, 0x19, 0x06, 0x08, 0x00, 0x10, 0x01, 0x20, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x6f, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, 0x64, - 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, - 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, 0x74, - 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, + 0x61, 0x67, 0x65, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0a, 0x73, 0x65, 0x6d, + 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x12, 0x59, 0x0a, 0x0b, 0x61, 0x6c, 0x74, 0x65, 0x72, + 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x35, 0x2e, 0x74, + 0x68, 0x65, 0x74, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x2e, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2e, 0x74, + 0x65, 0x73, 0x74, 0x2e, 0x53, 0x65, 0x6d, 0x61, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x4f, 0x6e, + 0x65, 0x4f, 0x66, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2e, 0x4e, 0x6f, 0x6e, 0x45, 0x6d, + 0x70, 0x74, 0x79, 0x48, 0x00, 0x52, 0x0b, 0x61, 0x6c, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x74, 0x69, + 0x76, 0x65, 0x1a, 0x07, 0x0a, 0x05, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x1a, 0x33, 0x0a, 0x08, 0x4e, + 0x6f, 0x6e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6c, 0x5f, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x62, 0x6f, 0x6f, + 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x08, 0xf2, 0xaa, 0x19, 0x04, 0x08, 0x00, 0x10, 0x01, + 0x3a, 0x0a, 0xf2, 0xaa, 0x19, 0x06, 0x08, 0x00, 0x10, 0x01, 0x20, 0x01, 0x42, 0x08, 0x0a, 0x06, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x39, 0x5a, 0x37, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, + 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x54, 0x68, 0x65, 0x54, 0x68, 0x69, 0x6e, 0x67, 0x73, 0x49, 0x6e, + 0x64, 0x75, 0x73, 0x74, 0x72, 0x69, 0x65, 0x73, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, + 0x67, 0x65, 0x6e, 0x2d, 0x67, 0x6f, 0x2d, 0x66, 0x6c, 0x61, 0x67, 0x73, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/test/golang/utils_test.go b/test/golang/utils_test.go index d5c0f6f..93987e8 100644 --- a/test/golang/utils_test.go +++ b/test/golang/utils_test.go @@ -42,7 +42,6 @@ func expectMessageEqual(t *testing.T, flagSet *pflag.FlagSet, arguments []string if generatedDiff != "" { t.Errorf("expected : %s", string(expectedMsgText)) - // t.Errorf("gogo : %s", string(gogoMsgText)) t.Errorf("generated: %s", string(generatedMsgText)) if generatedDiff != "" { t.Errorf(" diff : %s", generatedDiff) diff --git a/test/message.proto b/test/message.proto index 337f0c2..d7138db 100644 --- a/test/message.proto +++ b/test/message.proto @@ -4,7 +4,6 @@ syntax = "proto3"; import "annotations.proto"; -import "internal/gogoproto/gogo.proto"; package thethings.flags.test; From 169cdb04a346af9128c2fb8a5580aeab571003b2 Mon Sep 17 00:00:00 2001 From: Adrian-Stefan Mares Date: Mon, 3 Apr 2023 18:24:27 +0200 Subject: [PATCH 4/4] Update dependencies --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 7497d15..f6b8ed6 100644 --- a/go.mod +++ b/go.mod @@ -5,5 +5,5 @@ go 1.17 require ( github.com/google/go-cmp v0.5.9 github.com/spf13/pflag v1.0.5 - google.golang.org/protobuf v1.28.1 + google.golang.org/protobuf v1.30.0 ) diff --git a/go.sum b/go.sum index 37cc20e..70a45bc 100644 --- a/go.sum +++ b/go.sum @@ -6,5 +6,5 @@ github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= -google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w= -google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=