Skip to content
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

Merged
merged 1 commit into from
Dec 6, 2017
Merged

Simplify #314

merged 1 commit into from
Dec 6, 2017

Conversation

tamird
Copy link
Contributor

@tamird tamird commented Mar 17, 2017

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)

@tamird
Copy link
Contributor Author

tamird commented Jul 11, 2017

@LMMilewski it's been 3 months. Consider merging this, please?

@tamird
Copy link
Contributor Author

tamird commented Jul 12, 2017

@cybrcodr could you have a look please?

@cybrcodr
Copy link
Contributor

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.

@tamird tamird mentioned this pull request Nov 9, 2017
@tamird tamird changed the base branch from master to dev November 10, 2017 08:42
@tamird
Copy link
Contributor Author

tamird commented Nov 10, 2017

Updated to merge to dev rather than master and rebased to fix all detected issues.

@tamird
Copy link
Contributor Author

tamird commented Nov 20, 2017

@dsnet can you grab this one, too?

@dsnet
Copy link
Member

dsnet commented Nov 20, 2017

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
Copy link
Member

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.

Copy link
Contributor Author

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)
@dsnet dsnet merged commit 5c7dd33 into golang:dev Dec 6, 2017
@tamird tamird deleted the simple branch December 6, 2017 01:30
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants