Skip to content

Commit

Permalink
fix(ci,go): update linter in CI, fix depricated go feature
Browse files Browse the repository at this point in the history
Signed-off-by: Frederico Araujo <[email protected]>
  • Loading branch information
araujof committed Sep 5, 2023
1 parent 76c7b02 commit c2129af
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,17 @@ jobs:
- name: Setup Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: 1.19
- name: Init API module
working-directory: go
run: |
sudo apt update -qq && sudo apt install -yqq libdevmapper-dev
go mod init github.com/sysflow-telemetry/sf-apis/go || true
go mod tidy -compat=1.17
go mod tidy
- name: Lint go API
uses: golangci/golangci-lint-action@v3
with:
version: v1.47.1
version: v1.51.1
working-directory: go
args: --disable=errcheck --build-tags=exclude_graphdriver_btrfs
lint-python-api:
Expand Down
7 changes: 3 additions & 4 deletions go/secrets/secrets.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ package secrets
import (
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"strings"

Expand Down Expand Up @@ -76,7 +75,7 @@ func (s *Secrets) read(secret string) (string, error) {
if v, ok := s.secrets[secret]; ok {
return v, nil
}
buf, err := ioutil.ReadFile(s.secretsDir + "/" + secret)
buf, err := os.ReadFile(s.secretsDir + "/" + secret)
if err != nil {
return sfgo.Zeros.String, fmt.Errorf("secret %s does not exist or cannot be read: %v", secret, err)
}
Expand All @@ -88,9 +87,9 @@ func (s *Secrets) read(secret string) (string, error) {
// Checks if the given path is a directory. Returns nil if directory.
func isDir(path string) error {
if fi, err := os.Stat(path); os.IsNotExist(err) {
return fmt.Errorf("Path %s not found", path)
return fmt.Errorf("path %s not found", path)
} else if !fi.Mode().IsDir() {
return fmt.Errorf("Path %s is not a directory", path)
return fmt.Errorf("path %s is not a directory", path)
}
return nil
}

0 comments on commit c2129af

Please sign in to comment.