From bc6ee3d19b1644507206865ac495717ec1fcfbda Mon Sep 17 00:00:00 2001 From: Sarah Egler Date: Wed, 6 Apr 2022 20:19:20 -0700 Subject: [PATCH] Support proto3 field presence --- protoc-gen-twirpy/.idea/.gitignore | 8 ++++++ protoc-gen-twirpy/.idea/modules.xml | 8 ++++++ protoc-gen-twirpy/.idea/protoc-gen-twirpy.iml | 9 +++++++ protoc-gen-twirpy/.idea/vcs.xml | 6 +++++ protoc-gen-twirpy/generator/generator.go | 1 + protoc-gen-twirpy/go.mod | 4 +-- protoc-gen-twirpy/go.sum | 26 ++++++------------- 7 files changed, 42 insertions(+), 20 deletions(-) create mode 100644 protoc-gen-twirpy/.idea/.gitignore create mode 100644 protoc-gen-twirpy/.idea/modules.xml create mode 100644 protoc-gen-twirpy/.idea/protoc-gen-twirpy.iml create mode 100644 protoc-gen-twirpy/.idea/vcs.xml diff --git a/protoc-gen-twirpy/.idea/.gitignore b/protoc-gen-twirpy/.idea/.gitignore new file mode 100644 index 0000000..73f69e0 --- /dev/null +++ b/protoc-gen-twirpy/.idea/.gitignore @@ -0,0 +1,8 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml +# Editor-based HTTP Client requests +/httpRequests/ diff --git a/protoc-gen-twirpy/.idea/modules.xml b/protoc-gen-twirpy/.idea/modules.xml new file mode 100644 index 0000000..0588ef8 --- /dev/null +++ b/protoc-gen-twirpy/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/protoc-gen-twirpy/.idea/protoc-gen-twirpy.iml b/protoc-gen-twirpy/.idea/protoc-gen-twirpy.iml new file mode 100644 index 0000000..5e764c4 --- /dev/null +++ b/protoc-gen-twirpy/.idea/protoc-gen-twirpy.iml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/protoc-gen-twirpy/.idea/vcs.xml b/protoc-gen-twirpy/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/protoc-gen-twirpy/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/protoc-gen-twirpy/generator/generator.go b/protoc-gen-twirpy/generator/generator.go index 7b78795..7a3cbcd 100644 --- a/protoc-gen-twirpy/generator/generator.go +++ b/protoc-gen-twirpy/generator/generator.go @@ -14,6 +14,7 @@ import ( func Generate(r *plugin.CodeGeneratorRequest) *plugin.CodeGeneratorResponse { resp := &plugin.CodeGeneratorResponse{} + resp.SupportedFeatures = proto.Uint64(uint64(plugin.CodeGeneratorResponse_FEATURE_PROTO3_OPTIONAL)) files := r.GetFileToGenerate() for _, fileName := range files { diff --git a/protoc-gen-twirpy/go.mod b/protoc-gen-twirpy/go.mod index b34a3e8..040d1f1 100644 --- a/protoc-gen-twirpy/go.mod +++ b/protoc-gen-twirpy/go.mod @@ -3,6 +3,6 @@ module github.com/verloop/twirpy/protoc-gen-twirpy go 1.13 require ( - github.com/golang/protobuf v1.4.2 - google.golang.org/protobuf v1.23.0 + github.com/golang/protobuf v1.5.0 + google.golang.org/protobuf v1.28.0 ) diff --git a/protoc-gen-twirpy/go.sum b/protoc-gen-twirpy/go.sum index 1142833..8067092 100644 --- a/protoc-gen-twirpy/go.sum +++ b/protoc-gen-twirpy/go.sum @@ -1,19 +1,9 @@ -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/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/verloop/twirpy v0.0.0-20200412151843-f1b8d3e4ddaa h1:JWayDY76T33ESR/FpOwj5a1nzPH96TAAqK+M20UlA6k= +github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +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= +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.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= +google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=