Skip to content

Commit

Permalink
Chore: Addres golanglint-ci issues
Browse files Browse the repository at this point in the history
- Moved //nolint comment to inline to avoid gofmt/gofumpt/nolintlint
  colliding over the correct formatting
- Added empty comment between Godoc and //go:embed directive
- Prefer os.ReadFile over deprecated ioutil.ReadFile
  • Loading branch information
memes committed Aug 23, 2022
1 parent 9cb86c4 commit fb2548c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 1 addition & 2 deletions v2/cmd/pi/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ import (
)

// The default logr sink; this will be changed as command options are processed.
//nolint: gochecknoglobals // Global to package to avoid storing in context, etc.
var logger = logr.Discard()
var logger = logr.Discard() //nolint: gochecknoglobals // Global to package to avoid storing in context, etc.

func main() {
rootCmd, err := NewRootCmd()
Expand Down
4 changes: 2 additions & 2 deletions v2/cmd/pi/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"os"
)

// Failed to load CA cert.
Expand All @@ -25,7 +25,7 @@ func newCACertPool(cacerts []string) (*x509.CertPool, error) {
return nil, fmt.Errorf("failed to build new CA cert pool from SystemCertPool: %w", err)
}
for _, cacert := range cacerts {
ca, err := ioutil.ReadFile(cacert)
ca, err := os.ReadFile(cacert)
if err != nil {
return nil, fmt.Errorf("failed to read from certificate file %s: %w", cacert, err)
}
Expand Down
1 change: 1 addition & 0 deletions v2/pkg/generated/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ import _ "embed"

// SwaggerJSON contains the generated OpenAPIv2 (swagger) declaration exposed
// by REST endpoint.
//
//go:embed pi.swagger.json
var SwaggerJSON []byte

0 comments on commit fb2548c

Please sign in to comment.