-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Simplify #314
Simplify #314
Conversation
@LMMilewski it's been 3 months. Consider merging this, please? |
@cybrcodr could you have a look please? |
Hi @tamird, We've been maintaining 2 repos as source of truths, i.e. this one and an internal one. We've made several changes on performance improvements on the internal repo related to proto marshaling/unmarshaling. But that also means that both repos are quite a bit out of sync in most areas. jsonpb package is the exception and hence easier to sync. We would like to push out those internal changes to this repo and we're targeting that within a quarter. We'll have a branch for it first for users to try out before we merge it into master. While we appreciate your clean-ups in this PR and on #313 , but they'll present a bit of merge conflicts and some of the code that both PRs touch may no longer exist. Hence, we'd like to push back from merging these in for now until we have those changes sync'd to this repo. Our plan moving forwards after that major sync is to use this repo as the only source of truth. Sorry for having you update these PRs to head even before I had realized this potential issue. |
Updated to merge to dev rather than master and rebased to fix all detected issues. |
@dsnet can you grab this one, too? |
I’m out of office with barely any internet connection. This can wait till I get back |
.travis.yml
Outdated
@@ -10,9 +10,11 @@ install: | |||
- go get -v -d -t github.com/golang/protobuf/... | |||
- curl -L https://github.com/google/protobuf/releases/download/v3.3.0/protoc-3.3.0-linux-x86_64.zip -o /tmp/protoc.zip | |||
- unzip /tmp/protoc.zip -d $HOME/protoc | |||
- go get -u honnef.co/go/tools/cmd/megacheck |
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.
Revert. This will require a larger discussion to add a static analysis tool as part of the testing process.
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.
Done.
Found with honnef.co/go/tools/cmd/gosimple. proto/all_test.go:522:12: should use !strings.Contains(err.Error(), "Kind") instead (S1003) proto/all_test.go:1170:3: should merge variable declaration with assignment on next line (S1021) proto/all_test.go:1857:5: should use !strings.Contains(err.Error(), "RequiredField.Label") instead (S1003) proto/all_test.go:1873:5: should use !strings.Contains(err.Error(), "RequiredField.{Unknown}") instead (S1003) proto/all_test.go:1882:5: should use !strings.Contains(err.Error(), "RequiredField.Label") instead (S1003) proto/equal.go:149:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008) proto/message_set.go:97:2: should use 'return <expr>' instead of 'if <expr> { return <bool> }; return <bool>' (S1008) proto/properties.go:386:4: redundant break statement (S1023) proto/properties.go:434:4: redundant break statement (S1023) proto/properties.go:510:5: redundant break statement (S1023) proto/properties.go:520:5: redundant break statement (S1023) proto/properties.go:539:5: redundant break statement (S1023) proto/text.go:482:2: 'if err != nil { return err }; return nil' can be simplified to 'return err' (S1013) proto/text_parser.go:891:2: 'if pe != nil { return pe }; return nil' can be simplified to 'return pe' (S1013) protoc-gen-go/generator/generator.go:137:22: should use make([]string, n) instead (S1019)
Found with honnef.co/go/tools/cmd/gosimple.