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

minor style fixes #1

Merged
merged 1 commit into from
Jul 6, 2018
Merged

minor style fixes #1

merged 1 commit into from
Jul 6, 2018

Conversation

quasilyte
Copy link
Contributor

  • For if/else chain, switch statement is usually considered more idiomatic
  • If http package already imported, one may use its constants for method type
  • Params with same type can be combined
elector.go:131:2: elseif: should rewrite if-else to switch statement
elector.go:122:36: stdExpr: can replace "GET" with net/http.MethodGet
elector.go:179:35: stdExpr: can replace "PUT" with net/http.MethodPut
elector.go:87:1: paramTypeCombine: func(method string, url string, reqBody []byte) (resp *http.Response, resBody []byte, err error) could be replaced with func(method, url string, reqBody []byte) (resp *http.Response, resBody []byte, err error)
elector.go:246:1: paramTypeCombine: func(selfId string, consulUrl string, leaderHoldTime time.Duration) (inst *Instance, err error) could be replaced with func(selfId, consulUrl string, leaderHoldTime time.Duration) (inst *Instance, err error)

- For if/else chain, switch statement is usually considered more idiomatic
- If http package already imported, one may use its constants for method type
- Params with same type can be combined
@afiskon
Copy link
Owner

afiskon commented Jul 6, 2018

I see no reason why this PR should not be merged :) Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants