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

Update golangci-lint #7555

Closed
wants to merge 1 commit into from
Closed

Update golangci-lint #7555

wants to merge 1 commit into from

Conversation

SuperQ
Copy link
Member

@SuperQ SuperQ commented Jul 11, 2020

  • Update to latest release.
  • Remove install -d workaround0.

Signed-off-by: Ben Kochie superq@gmail.com

* Update to latest release.
* Remove `install -d` workaround[0].

[0]: golangci/golangci-lint#672

Signed-off-by: Ben Kochie <superq@gmail.com>
@SuperQ
Copy link
Member Author

SuperQ commented Jul 11, 2020

Some new errors:

discovery/openstack/hypervisor_test.go:62:24: SA5011: possible nil pointer dereference (staticcheck)
  testutil.Assert(t, tg.Targets != nil, "")
                        ^
discovery/openstack/hypervisor_test.go:63:31: SA5011: possible nil pointer dereference (staticcheck)
  testutil.Equals(t, 2, len(tg.Targets))
                               ^
discovery/triton/triton_test.go:90:24: SA5011: possible nil pointer dereference (staticcheck)
  testutil.Assert(t, td.client != nil, "")
                        ^
promql/engine.go:1442:16: SA6002: argument should be pointer-like to avoid allocations (staticcheck)
  pointPool.Put(p[:0])
                ^
tsdb/head.go:551:19: SA6002: argument should be pointer-like to avoid allocations (staticcheck)
      seriesPool.Put(v)
                     ^
tsdb/head.go:584:20: SA6002: argument should be pointer-like to avoid allocations (staticcheck)
      samplesPool.Put(v)
                      ^

@roidelapluie
Copy link
Member

cc @pracucci what do you think about the TSDB ones?

@bwplotka
Copy link
Member

It's red herring as it's bytes slice IMO, but we can make it explicit pointer if needed (:

@pracucci
Copy link
Contributor

cc @pracucci what do you think about the TSDB ones?

There's already a comment //lint:ignore SA6002 relax staticcheck verification. but looks the directive is now ignored? Not sure what's happening.

@mneverov
Copy link
Contributor

mneverov commented Aug 7, 2020

There is a bug in golangci-lint which causes //lint:ignore SA6002 ... be ignored.

@SuperQ
Copy link
Member Author

SuperQ commented Sep 3, 2020

Closing this until the upstream issue is fixed.

@SuperQ SuperQ closed this Sep 3, 2020
@SuperQ SuperQ deleted the superq/bump_golangci-lint branch September 3, 2020 04:49
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.

None yet

5 participants