Skip to content

minor style fixes#1

Merged
afiskon merged 1 commit into
afiskon:masterfrom
quasilyte:master
Jul 6, 2018
Merged

minor style fixes#1
afiskon merged 1 commit into
afiskon:masterfrom
quasilyte:master

Conversation

@quasilyte

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

afiskon commented Jul 6, 2018

Copy link
Copy Markdown
Owner

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