atc0005 / check-cert

Go-based tooling to check/verify certs
MIT License
19 stars 3 forks source link

errwrap linting errors: `call could wrap the error with error-wrapping directive %w` #564

Open atc0005 opened 1 year ago

atc0005 commented 1 year ago

Surfaced by errwrap v1.5.0:

/__w/check-cert/check-cert/internal/netutils/net.go:354:27: call could wrap the error with error-wrapping directive %w
/__w/check-cert/check-cert/internal/netutils/net.go:592:26: call could wrap the error with error-wrapping directive %w
/__w/check-cert/check-cert/internal/config/config.go:167:11: call could wrap the error with error-wrapping directive %w
/__w/check-cert/check-cert/cmd/check_cert/annotations.go:76:48: call could wrap the error with error-wrapping directive %w
atc0005 commented 1 year ago

Surfaced by errwrap v1.5.0:

/__w/check-cert/check-cert/cmd/check_cert/annotations.go:76:48: call could wrap the error with error-wrapping directive %w

Reported this one upstream to the linter author/maintainer. This looks like a false-positive:

https://github.com/atc0005/check-cert/blob/b8e02c30cf4692b50c6de54c2d8eb161eeb87803/cmd/check_cert/annotations.go#L76-L81

atc0005 commented 1 year ago

Another likely false-positive:

/__w/check-cert/check-cert/internal/netutils/net.go:592:26: call could wrap the error with error-wrapping directive %w

https://github.com/atc0005/check-cert/blob/b8e02c30cf4692b50c6de54c2d8eb161eeb87803/internal/netutils/net.go#L592-L597

This syntax would be supported in Go 1.20, but is not in Go 1.19 (linter intends to support back to Go 1.16).