From faa4d12afc27257f317d80675bc0038a04910eac Mon Sep 17 00:00:00 2001 From: Gorka Lerchundi Osa Date: Tue, 4 May 2021 02:40:27 +0200 Subject: [PATCH] *: use latest golang/protobuf version for library & code generator (#93) --- Makefile | 10 +++---- go.mod | 2 +- go.sum | 26 ++++++------------- lang/go/Makefile | 6 ++--- lang/go/name_test.go | 7 ++--- lang/go/package_test.go | 4 --- lang/go/testdata/names/digit/digit.proto | 5 ---- lang/go/testdata/names/digit/params | 0 .../go/testdata/names/entities/entities.proto | 8 +----- .../names/import_path/import_path.proto | 4 --- lang/go/testdata/names/import_path/params | 1 - .../import_path_mapped.proto | 2 +- .../testdata/names/import_path_mapped/params | 2 +- lang/go/testdata/names/keyword/keyword.proto | 2 +- lang/go/testdata/names/mapped/mapped.proto | 2 +- lang/go/testdata/names/mapped/params | 2 +- .../names/none/NO.pack--age.name$.proto | 3 --- lang/go/testdata/names/none/params | 0 lang/go/testdata/names/package/package.proto | 2 +- .../names/transitive_package/other.proto | 2 +- .../names/transitive_package/transitive.proto | 2 ++ lang/go/testdata/names/unnamed/params | 0 lang/go/testdata/names/unnamed/unnamed.proto | 5 ---- lang/go/testdata/outputs/mapped/mapped.proto | 2 +- lang/go/testdata/outputs/mapped/params | 2 +- .../outputs/mapped_srcrel/mapped.proto | 2 +- lang/go/testdata/outputs/mapped_srcrel/params | 2 +- lang/go/testdata/outputs/none/none.proto | 1 + .../testdata/outputs/none_srcrel/none.proto | 2 ++ .../outputs/unqualified/unqualified.proto | 2 +- .../unqualified_srcrel/unqualified.proto | 2 +- lang/go/testdata/packages/mapped/mapped.proto | 2 +- .../testdata/packages/targets/none/none.proto | 1 + .../targets/unqualified/unqualified.proto | 2 +- tools.go | 7 +++++ 35 files changed, 48 insertions(+), 76 deletions(-) delete mode 100644 lang/go/testdata/names/digit/digit.proto delete mode 100644 lang/go/testdata/names/digit/params delete mode 100644 lang/go/testdata/names/import_path/import_path.proto delete mode 100644 lang/go/testdata/names/import_path/params delete mode 100644 lang/go/testdata/names/none/NO.pack--age.name$.proto delete mode 100644 lang/go/testdata/names/none/params delete mode 100644 lang/go/testdata/names/unnamed/params delete mode 100644 lang/go/testdata/names/unnamed/unnamed.proto create mode 100644 tools.go diff --git a/Makefile b/Makefile index 709fbd0..7a6d4b9 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ testdata: testdata-graph testdata-go testdata/generated testdata/fdset.bin # gen .PHONY: testdata-graph testdata-graph: bin/protoc-gen-debug # parses the proto file sets in testdata/graph and renders binary CodeGeneratorRequest - set -e; for subdir in `find ./testdata/graph -type d -mindepth 1 -maxdepth 1`; do \ + set -e; for subdir in `find ./testdata/graph -mindepth 1 -maxdepth 1 -type d`; do \ protoc -I ./testdata/graph \ --plugin=protoc-gen-debug=./bin/protoc-gen-debug \ --debug_out="$$subdir:$$subdir" \ @@ -49,15 +49,15 @@ testdata/generated: protoc-gen-go bin/protoc-gen-example which protoc-gen-go || (go install github.com/golang/protobuf/protoc-gen-go) rm -rf ./testdata/generated && mkdir -p ./testdata/generated # generate the official go code, must be one directory at a time - set -e; for subdir in `find ./testdata/protos -type d -mindepth 1`; do \ - files=`find $$subdir -name "*.proto" -maxdepth 1`; \ + set -e; for subdir in `find ./testdata/protos -mindepth 1 -type d`; do \ + files=`find $$subdir -maxdepth 1 -name "*.proto"`; \ [ ! -z "$$files" ] && \ protoc -I ./testdata/protos \ --go_out="$$GOPATH/src" \ $$files; \ done # generate using our demo plugin, don't need to go directory at a time - set -e; for subdir in `find ./testdata/protos -type d -mindepth 1 -maxdepth 1`; do \ + set -e; for subdir in `find ./testdata/protos -mindepth 1 -maxdepth 1 -type d`; do \ protoc -I ./testdata/protos \ --plugin=protoc-gen-example=./bin/protoc-gen-example \ --example_out="paths=source_relative:./testdata/generated" \ @@ -83,7 +83,7 @@ vendor: # install project dependencies .PHONY: protoc-gen-go protoc-gen-go: - which protoc-gen-go || (go get -u github.com/golang/protobuf/protoc-gen-go) + which protoc-gen-go || (go install github.com/golang/protobuf/protoc-gen-go) bin/protoc-gen-example: # creates the demo protoc plugin for demonstrating uses of PG* go build -o ./bin/protoc-gen-example ./testdata/protoc-gen-example diff --git a/go.mod b/go.mod index c185fcc..3c40def 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/lyft/protoc-gen-star go 1.14 require ( - github.com/golang/protobuf v1.4.2 + github.com/golang/protobuf v1.5.2 github.com/spf13/afero v1.3.3 github.com/stretchr/testify v1.6.1 ) diff --git a/go.sum b/go.sum index a0ec335..ee1a4ef 100644 --- a/go.sum +++ b/go.sum @@ -1,16 +1,10 @@ github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= -github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= -github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= -github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= -github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= -github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0= -github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= @@ -31,13 +25,9 @@ golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= -google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= -google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= -google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= -google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= -google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM= -google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0 h1:bxAC2xTBsZGibn2RTntX0oH50xLsqy1OxA9tTL3p/lk= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/lang/go/Makefile b/lang/go/Makefile index a4dac5c..cf308ad 100644 --- a/lang/go/Makefile +++ b/lang/go/Makefile @@ -1,7 +1,7 @@ .PHONY: testdata-go-names testdata-names: ../../bin/protoc-gen-debug # parse the proto file sets in testdata/names and renders binary CodeGeneratorRequest + official go codegen cd testdata/names && \ - set -e; for subdir in `find . -type d -mindepth 1 -maxdepth 1`; do \ + set -e; for subdir in `find . -mindepth 1 -maxdepth 1 -type d`; do \ cd $$subdir; \ params=`cat params`; \ protoc -I . \ @@ -14,7 +14,7 @@ testdata-names: ../../bin/protoc-gen-debug # parse the proto file sets in testda testdata-packages: ../../bin/protoc-gen-debug cd testdata/packages && \ - set -e; for subdir in `find . -type d -mindepth 1 -maxdepth 1 | grep -v targets`; do \ + set -e; for subdir in `find . -mindepth 1 -maxdepth 1 -type d | grep -v targets`; do \ cd $$subdir; \ params=`cat params`; \ protoc -I . -I .. \ @@ -27,7 +27,7 @@ testdata-packages: ../../bin/protoc-gen-debug testdata-outputs: ../../bin/protoc-gen-debug cd testdata/outputs && \ - set -e; for subdir in `find . -type d -mindepth 1 -maxdepth 1`; do \ + set -e; for subdir in `find . -mindepth 1 -maxdepth 1 -type d`; do \ cd $$subdir; \ params=`cat params`; \ protoc -I . -I .. \ diff --git a/lang/go/name_test.go b/lang/go/name_test.go index 80e44a1..08ca697 100644 --- a/lang/go/name_test.go +++ b/lang/go/name_test.go @@ -35,8 +35,8 @@ func TestName(t *testing.T) { ctx := loadContext(t, "names", "entities") f := ast.Targets()["entities.proto"] - assert.Equal(t, pgs.Name("BAD_pack__age_name_"), ctx.Name(f)) - assert.Equal(t, pgs.Name("BAD_pack__age_name_"), ctx.Name(f.Package())) + assert.Equal(t, pgs.Name("entities"), ctx.Name(f)) + assert.Equal(t, pgs.Name("entities"), ctx.Name(f.Package())) assert.Panics(t, func() { ctx.Name(nil) @@ -54,15 +54,12 @@ func TestName(t *testing.T) { {"lower_snake_case", "LowerSnakeCase"}, {"lowercase", "Lowercase"}, {"UPPERCASE", "UPPERCASE"}, - {"_underscore", "XUnderscore"}, - {"__DoubleUnderscore", "X_DoubleUnderscore"}, {"String", "String"}, {"MsgWith3dInside", "MsgWith3DInside"}, {"MsgEndsWith3d", "MsgEndsWith3D"}, // Nested Messages {"Nested.Message", "Nested_Message"}, - {"Nested._underscore", "Nested_XUnderscore"}, {"Nested.String", "Nested_String"}, {"Nested.Message.Message", "Nested_Message_Message"}, {"Nested.lowerMsg", "NestedLowerMsg"}, diff --git a/lang/go/package_test.go b/lang/go/package_test.go index 72623b0..c86ef08 100644 --- a/lang/go/package_test.go +++ b/lang/go/package_test.go @@ -16,16 +16,12 @@ func TestPackageName(t *testing.T) { expected pgs.Name }{ {"keyword", "_package"}, // go keywords are prefixed with _ - {"none", "NO_pack__age_name_"}, // if there is no package or go_package option, use the input filepath {"package", "my_package"}, // use the go_package option - {"unnamed", "names_unnamed"}, // use the proto package if no go_package {"import", "bar"}, // uses the basename if go_package contains a / {"override", "baz"}, // if go_package contains ;, use everything to the right - {"import_path", "_package"}, // import_path param used if no go_package option {"mapped", "unaffected"}, // M mapped params are ignored for build targets {"import_path_mapped", "go_package"}, // mixed import_path and M parameters should lose to go_package {"transitive_package", "foobar"}, // go_option gets picked up from other files if present - {"digit", "_2019fizz"}, // digit at the start are prefixed with _ {"path_dash", "path_dash"}, // if basename of go_package contains invalid characters, replace with _ } diff --git a/lang/go/testdata/names/digit/digit.proto b/lang/go/testdata/names/digit/digit.proto deleted file mode 100644 index 4bbb269..0000000 --- a/lang/go/testdata/names/digit/digit.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax="proto3"; - -package names.digit; -option go_package = "2019fizz"; - diff --git a/lang/go/testdata/names/digit/params b/lang/go/testdata/names/digit/params deleted file mode 100644 index e69de29..0000000 diff --git a/lang/go/testdata/names/entities/entities.proto b/lang/go/testdata/names/entities/entities.proto index 2c4728d..8abee2c 100644 --- a/lang/go/testdata/names/entities/entities.proto +++ b/lang/go/testdata/names/entities/entities.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package names.entities; -option go_package = "BAD.pack--age.name$"; +option go_package = "example.com/names/entities"; message UpperCamelCaseMessage {} @@ -17,10 +17,6 @@ message lowercase {} message UPPERCASE {} -message _underscore {} - -message __DoubleUnderscore {} - message String {} // protected name message Nested { @@ -30,8 +26,6 @@ message Nested { enum Enum { NESTED = 0; } } - message _underscore {} - message String {} // protected name enum Enum { VALUE = 0; } diff --git a/lang/go/testdata/names/import_path/import_path.proto b/lang/go/testdata/names/import_path/import_path.proto deleted file mode 100644 index 245b082..0000000 --- a/lang/go/testdata/names/import_path/import_path.proto +++ /dev/null @@ -1,4 +0,0 @@ -syntax="proto3"; -package names.import_path; - -message ImportPath {} diff --git a/lang/go/testdata/names/import_path/params b/lang/go/testdata/names/import_path/params deleted file mode 100644 index e4626a4..0000000 --- a/lang/go/testdata/names/import_path/params +++ /dev/null @@ -1 +0,0 @@ -Mnames/import_path/import_path.proto=foobar,import_path=package diff --git a/lang/go/testdata/names/import_path_mapped/import_path_mapped.proto b/lang/go/testdata/names/import_path_mapped/import_path_mapped.proto index 4b56a69..7632293 100644 --- a/lang/go/testdata/names/import_path_mapped/import_path_mapped.proto +++ b/lang/go/testdata/names/import_path_mapped/import_path_mapped.proto @@ -1,5 +1,5 @@ syntax="proto3"; package names.import_path_mapped; -option go_package="go_package"; +option go_package="github.com/fizz/buzz;go_package"; message Mapped {} diff --git a/lang/go/testdata/names/import_path_mapped/params b/lang/go/testdata/names/import_path_mapped/params index 45c747d..bb1e6eb 100644 --- a/lang/go/testdata/names/import_path_mapped/params +++ b/lang/go/testdata/names/import_path_mapped/params @@ -1 +1 @@ -Mimport_path_mapped.proto=github.com/foo/bar,import_path=github.com/fizz/buzz +Mimport_path_mapped.proto=github.com/foo/bar diff --git a/lang/go/testdata/names/keyword/keyword.proto b/lang/go/testdata/names/keyword/keyword.proto index 2606940..34c6923 100644 --- a/lang/go/testdata/names/keyword/keyword.proto +++ b/lang/go/testdata/names/keyword/keyword.proto @@ -1,6 +1,6 @@ syntax="proto3"; package names.keyword; -option go_package = "package"; +option go_package = "example.com/package"; message Package {} diff --git a/lang/go/testdata/names/mapped/mapped.proto b/lang/go/testdata/names/mapped/mapped.proto index b00f493..1735985 100644 --- a/lang/go/testdata/names/mapped/mapped.proto +++ b/lang/go/testdata/names/mapped/mapped.proto @@ -1,5 +1,5 @@ syntax="proto3"; package names.mapped; -option go_package="unaffected"; +option go_package="./;unaffected"; message Mapped {} diff --git a/lang/go/testdata/names/mapped/params b/lang/go/testdata/names/mapped/params index b47ee5a..f2c6140 100644 --- a/lang/go/testdata/names/mapped/params +++ b/lang/go/testdata/names/mapped/params @@ -1 +1 @@ -Mmapped.proto=foobar +Mmapped.proto=example.com/foobar diff --git a/lang/go/testdata/names/none/NO.pack--age.name$.proto b/lang/go/testdata/names/none/NO.pack--age.name$.proto deleted file mode 100644 index c99805e..0000000 --- a/lang/go/testdata/names/none/NO.pack--age.name$.proto +++ /dev/null @@ -1,3 +0,0 @@ -syntax="proto3"; - -message None {} diff --git a/lang/go/testdata/names/none/params b/lang/go/testdata/names/none/params deleted file mode 100644 index e69de29..0000000 diff --git a/lang/go/testdata/names/package/package.proto b/lang/go/testdata/names/package/package.proto index ad7c2b1..6d0c16e 100644 --- a/lang/go/testdata/names/package/package.proto +++ b/lang/go/testdata/names/package/package.proto @@ -1,6 +1,6 @@ syntax="proto3"; package names.package; -option go_package = "my_package"; +option go_package = "example.com/names/package;my_package"; message Package {} diff --git a/lang/go/testdata/names/transitive_package/other.proto b/lang/go/testdata/names/transitive_package/other.proto index 33d26e9..dab27be 100644 --- a/lang/go/testdata/names/transitive_package/other.proto +++ b/lang/go/testdata/names/transitive_package/other.proto @@ -1,7 +1,7 @@ syntax="proto3"; package names.transitive_package; -option go_package="foobar"; +option go_package="example.com/names/foobar"; message Other { bool value = 1; diff --git a/lang/go/testdata/names/transitive_package/transitive.proto b/lang/go/testdata/names/transitive_package/transitive.proto index 44f66f7..d83f2bd 100644 --- a/lang/go/testdata/names/transitive_package/transitive.proto +++ b/lang/go/testdata/names/transitive_package/transitive.proto @@ -1,6 +1,8 @@ syntax="proto3"; package names.transitive_package; +option go_package="example.com/names/foobar"; + message Transitive { bool value = 1; } diff --git a/lang/go/testdata/names/unnamed/params b/lang/go/testdata/names/unnamed/params deleted file mode 100644 index e69de29..0000000 diff --git a/lang/go/testdata/names/unnamed/unnamed.proto b/lang/go/testdata/names/unnamed/unnamed.proto deleted file mode 100644 index a674e38..0000000 --- a/lang/go/testdata/names/unnamed/unnamed.proto +++ /dev/null @@ -1,5 +0,0 @@ -syntax = "proto3"; - -package names.unnamed; - -message Unnamed {} diff --git a/lang/go/testdata/outputs/mapped/mapped.proto b/lang/go/testdata/outputs/mapped/mapped.proto index 8970d7c..5aadb78 100644 --- a/lang/go/testdata/outputs/mapped/mapped.proto +++ b/lang/go/testdata/outputs/mapped/mapped.proto @@ -1,5 +1,5 @@ syntax="proto3"; package outputs.mapped; -option go_package="unaffected"; +option go_package="./;mapped"; message Mapped {} diff --git a/lang/go/testdata/outputs/mapped/params b/lang/go/testdata/outputs/mapped/params index b47ee5a..f2c6140 100644 --- a/lang/go/testdata/outputs/mapped/params +++ b/lang/go/testdata/outputs/mapped/params @@ -1 +1 @@ -Mmapped.proto=foobar +Mmapped.proto=example.com/foobar diff --git a/lang/go/testdata/outputs/mapped_srcrel/mapped.proto b/lang/go/testdata/outputs/mapped_srcrel/mapped.proto index 8970d7c..5aadb78 100644 --- a/lang/go/testdata/outputs/mapped_srcrel/mapped.proto +++ b/lang/go/testdata/outputs/mapped_srcrel/mapped.proto @@ -1,5 +1,5 @@ syntax="proto3"; package outputs.mapped; -option go_package="unaffected"; +option go_package="./;mapped"; message Mapped {} diff --git a/lang/go/testdata/outputs/mapped_srcrel/params b/lang/go/testdata/outputs/mapped_srcrel/params index cf3c0e4..5b9b814 100644 --- a/lang/go/testdata/outputs/mapped_srcrel/params +++ b/lang/go/testdata/outputs/mapped_srcrel/params @@ -1 +1 @@ -paths=source_relative,Mmapped.proto=foobar +paths=source_relative,Mmapped.proto=example.com/foobar diff --git a/lang/go/testdata/outputs/none/none.proto b/lang/go/testdata/outputs/none/none.proto index a7c41d7..e63c8aa 100644 --- a/lang/go/testdata/outputs/none/none.proto +++ b/lang/go/testdata/outputs/none/none.proto @@ -1,3 +1,4 @@ syntax="proto3"; package outputs.none; +option go_package="./;none"; message None {} diff --git a/lang/go/testdata/outputs/none_srcrel/none.proto b/lang/go/testdata/outputs/none_srcrel/none.proto index c99805e..6e4f296 100644 --- a/lang/go/testdata/outputs/none_srcrel/none.proto +++ b/lang/go/testdata/outputs/none_srcrel/none.proto @@ -1,3 +1,5 @@ syntax="proto3"; +option go_package="example.com/outputs/none"; + message None {} diff --git a/lang/go/testdata/outputs/unqualified/unqualified.proto b/lang/go/testdata/outputs/unqualified/unqualified.proto index 866369f..16b2cd4 100644 --- a/lang/go/testdata/outputs/unqualified/unqualified.proto +++ b/lang/go/testdata/outputs/unqualified/unqualified.proto @@ -1,5 +1,5 @@ syntax="proto3"; package outputs.unqualified; -option go_package="unqualified"; +option go_package="./;unqualified"; message Unqualified{} diff --git a/lang/go/testdata/outputs/unqualified_srcrel/unqualified.proto b/lang/go/testdata/outputs/unqualified_srcrel/unqualified.proto index 866369f..2cbaa0a 100644 --- a/lang/go/testdata/outputs/unqualified_srcrel/unqualified.proto +++ b/lang/go/testdata/outputs/unqualified_srcrel/unqualified.proto @@ -1,5 +1,5 @@ syntax="proto3"; package outputs.unqualified; -option go_package="unqualified"; +option go_package="example.com/outputs/unqualified"; message Unqualified{} diff --git a/lang/go/testdata/packages/mapped/mapped.proto b/lang/go/testdata/packages/mapped/mapped.proto index 8053ce0..4c3b77d 100644 --- a/lang/go/testdata/packages/mapped/mapped.proto +++ b/lang/go/testdata/packages/mapped/mapped.proto @@ -1,6 +1,6 @@ syntax="proto3"; package packages.mapped; -option go_package="example.com/packages/mapped"; +option go_package="./;mapped"; import "targets/fully_qualified/fully_qualified.proto"; import "targets/unqualified/unqualified.proto"; diff --git a/lang/go/testdata/packages/targets/none/none.proto b/lang/go/testdata/packages/targets/none/none.proto index 5e9eb79..e35851c 100644 --- a/lang/go/testdata/packages/targets/none/none.proto +++ b/lang/go/testdata/packages/targets/none/none.proto @@ -1,4 +1,5 @@ syntax="proto3"; package packages.targets.none; +option go_package="targets/none"; message None{} diff --git a/lang/go/testdata/packages/targets/unqualified/unqualified.proto b/lang/go/testdata/packages/targets/unqualified/unqualified.proto index d955772..821447a 100644 --- a/lang/go/testdata/packages/targets/unqualified/unqualified.proto +++ b/lang/go/testdata/packages/targets/unqualified/unqualified.proto @@ -1,5 +1,5 @@ syntax="proto3"; package packages.targets.unqualified; -option go_package="unqualified"; +option go_package="targets/unqualified"; message Unqualified{} diff --git a/tools.go b/tools.go new file mode 100644 index 0000000..37283e2 --- /dev/null +++ b/tools.go @@ -0,0 +1,7 @@ +// +build tools + +package tools + +import ( + _ "github.com/golang/protobuf/protoc-gen-go" +)