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

Try to make (make lint) pass with Go 1.18 #1492

Merged
merged 1 commit into from
Mar 16, 2022

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Mar 15, 2022

This is an attempt to fix (make lint), which complains:

pkg/tlsclientconfig/tlsclientconfig_test.go:37:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
      for _, s := range tlsc.RootCAs.Subjects() {
                        ^
pkg/tlsclientconfig/tlsclientconfig_test.go:43:20: SA1019: systemCertPool.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
      for _, s := range systemCertPool.Subjects() {
                        ^
pkg/tlsclientconfig/tlsclientconfig_test.go:53:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
      for _, s := range tlsc.RootCAs.Subjects() {

... but the same staticcheck linter, for some reason, does NOT complain about these deprecated fields; the correct //lint:ignore comments are ineffective and actually cause extra warnings.

So, silence all of staticcheck via //nolint , hopefully temporarily.

(Also, note that golangci-lint itself, with this update, crashes with golangci/golangci-lint#2374 ;
a local rebuild does not crash, but still fails per the above.)

This is an attempt to fix (make lint), which complains:
> pkg/tlsclientconfig/tlsclientconfig_test.go:37:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
>       for _, s := range tlsc.RootCAs.Subjects() {
>                         ^
> pkg/tlsclientconfig/tlsclientconfig_test.go:43:20: SA1019: systemCertPool.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
>       for _, s := range systemCertPool.Subjects() {
>                         ^
> pkg/tlsclientconfig/tlsclientconfig_test.go:53:20: SA1019: tlsc.RootCAs.Subjects is deprecated: if s was returned by SystemCertPool, Subjects will not include the system roots. (staticcheck)
>       for _, s := range tlsc.RootCAs.Subjects() {

... but the same staticcheck linter, for some reason, does NOT
complain about these deprecated fields; the correct //lint:ignore
comments are ineffective and actually cause extra warnings.

So, silence all of staticcheck via //nolint , hopefully temporarily.

(Also, note that golangci-lint itself, with this update,
crashes with golangci/golangci-lint#2374 ;
a local rebuild does not crash, but still fails per the above.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
Copy link
Member

@vrothberg vrothberg left a comment

Choose a reason for hiding this comment

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

LGTM

@vrothberg vrothberg merged commit 7896383 into containers:main Mar 16, 2022
@mtrmac mtrmac deleted the lint-1.18 branch March 16, 2022 13: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.

2 participants