-
Notifications
You must be signed in to change notification settings - Fork 76
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
field: fix missing optional support #95
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
32ee6de
protoc-gen-debug: add optional support
snqk 7424ee8
field: fix missing optional support, update protoc
snqk 5232966
proto: updated notes for proto3 field presence
snqk 9d6de96
travis: revert golang version
snqk 69f0811
generator: add proto3 optional init option
snqk 552c18e
pgs: add support for proto3 field presence
snqk e0bab48
pgs: add support for proto3 field presence
snqk 2d3f0a8
pgs (field presence): nit/style fixes
snqk 7af882f
pgs (field presence): nit/fixes
snqk 3eb9739
pgs (field presence): split proto3 tests
snqk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
syntax="proto3"; | ||
package names.types; | ||
option go_package = "example.com/foo/bar"; | ||
|
||
import "google/protobuf/duration.proto"; | ||
import "google/protobuf/type.proto"; | ||
|
||
message Proto3 { | ||
double double = 1; | ||
float float = 2; | ||
int64 int64 = 3; | ||
sfixed64 sfixed64 = 4; | ||
sint64 sint64 = 5; | ||
uint64 uint64 = 6; | ||
fixed64 fixed64 = 7; | ||
int32 int32 = 8; | ||
sfixed32 sfixed32 = 9; | ||
sint32 sint32 = 10; | ||
uint32 uint32 = 11; | ||
fixed32 fixed32 = 12; | ||
bool bool = 13; | ||
string string = 14; | ||
bytes bytes = 15; | ||
|
||
Enum enum = 16; | ||
google.protobuf.Syntax ext_enum = 17; | ||
Message msg = 18; | ||
google.protobuf.Duration ext_msg = 19; | ||
|
||
repeated double repeated_scalar = 20; | ||
repeated Enum repeated_enum = 21; | ||
repeated google.protobuf.Syntax repeated_ext_enum = 22; | ||
repeated Message repeated_msg = 23; | ||
repeated google.protobuf.Duration repeated_ext_msg = 24; | ||
|
||
map<string, float> map_scalar = 25; | ||
map<int32, Enum> map_enum = 26; | ||
map<uint64, google.protobuf.Syntax> map_ext_enum = 27; | ||
map<fixed32, Message> map_msg = 28; | ||
map<sfixed64, google.protobuf.Duration> map_ext_msg = 29; | ||
|
||
enum Enum {VALUE = 0;} | ||
|
||
message Message {} | ||
|
||
message Optional { | ||
optional double double = 1; | ||
optional float float = 2; | ||
optional int64 int64 = 3; | ||
optional sfixed64 sfixed64 = 4; | ||
optional sint64 sint64 = 5; | ||
optional uint64 uint64 = 6; | ||
optional fixed64 fixed64 = 7; | ||
optional int32 int32 = 8; | ||
optional sfixed32 sfixed32 = 9; | ||
optional sint32 sint32 = 10; | ||
optional uint32 uint32 = 11; | ||
optional fixed32 fixed32 = 12; | ||
optional bool bool = 13; | ||
optional string string = 14; | ||
optional bytes bytes = 15; | ||
optional Enum enum = 16; | ||
optional google.protobuf.Syntax ext_enum = 17; | ||
optional Optional msg = 18; | ||
optional google.protobuf.Duration ext_msg = 19; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we please keep the other ones and just add on 3.16.0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You may need to use https://mickey.dev/posts/go-build-tags-testing/ (for example) to mark which tests apply to the older protoc versions versus newer. But I think I really don't want to lose test coverage for the old versions, esp since it should be relatively easy to keep them. WDYT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, this is turning out to be tricker than I anticipated.
I need to first edit the makefiles to ensure they don't compile the proto3 optional bits, then ensure I add the build tags for the golang tests themselves..
I am testing by isolating the testing harness into
testdata/proto3_presence
for now, but let me know if you prefer a different name.