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

fixed linting reported from glangci-lint #11

Merged
merged 3 commits into from
Jul 14, 2020
Merged

fixed linting reported from glangci-lint #11

merged 3 commits into from
Jul 14, 2020

Conversation

rockspore
Copy link
Contributor

#9

@codecov
Copy link

codecov bot commented Jul 14, 2020

Codecov Report

Merging #11 into master will decrease coverage by 1.86%.
The diff coverage is 31.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #11      +/-   ##
==========================================
- Coverage   72.35%   70.49%   -1.87%     
==========================================
  Files           6        6              
  Lines         944      959      +15     
==========================================
- Hits          683      676       -7     
- Misses        147      158      +11     
- Partials      114      125      +11     
Impacted Files Coverage Δ
cmd/provision/provision.go 77.70% <ø> (ø)
cmd/provision/proxy.go 52.63% <0.00%> (-3.66%) ⬇️
cmd/token/token.go 73.02% <33.33%> (-2.31%) ⬇️
cmd/provision/legacy.go 60.46% <37.50%> (-5.37%) ⬇️
cmd/bindings/bindings.go 76.13% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5ac3d02...d5db255. Read the comment docs.

@rockspore rockspore marked this pull request as ready for review July 14, 2020 20:05
@theganyo theganyo linked an issue Jul 14, 2020 that may be closed by this pull request
@@ -76,7 +76,9 @@ func cmdBindingsList(b *bindings, printf shared.FormatFn) *cobra.Command {
Args: cobra.NoArgs,

Run: func(cmd *cobra.Command, _ []string) {
b.cmdList(printf)
if err := b.cmdList(printf); err != nil {
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the functions like these, we should probably just return the error. Just change the Run: to RunE: and the internal code to return b.cmdList(printf) instead of doing the if check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know! Will correct it shortly.

@@ -164,7 +164,9 @@ func productTestServer() *httptest.Server {

return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(res)
if err := json.NewEncoder(w).Encode(res); err != nil {
return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We always either return or log the error - unless the error is absolutely impossible or can't cause side-effects, in which case we can assign to _, but that should be rare. Apply this comment to the other cases...

@theganyo theganyo merged commit 368f1a5 into master Jul 14, 2020
@theganyo theganyo deleted the issue-9 branch July 14, 2020 22:19
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.

address linter issues
2 participants