Skip to content

Commit

Permalink
ci: update test/lint pipeline
Browse files Browse the repository at this point in the history
Also correct some linter issues.
  • Loading branch information
dmke committed Nov 17, 2023
1 parent 148f953 commit 5e563b9
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest

env:
GO_VERSION: 1.16
GO_VERSION: 1.21

steps:
- name: Set up Go ${{ env.GO_VERSION }}
Expand Down Expand Up @@ -40,4 +40,4 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.37
version: v1.52
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:

strategy:
matrix:
go-version: [1.13, 1.14, 1.15, 1.16, 1.x]
go-version: [1.20, 1.21, 1.x]

steps:
- name: Set up Go ${{ matrix.go-version }}
Expand Down
7 changes: 3 additions & 4 deletions uci.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package uci
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sync"
Expand Down Expand Up @@ -118,7 +117,7 @@ func (t *tree) LoadConfig(name string, forceReload bool) error {
// loadConfig actually reads a config file. Its call must be guarded by
// locking the tree's mutex.
func (t *tree) loadConfig(name string) error {
body, err := ioutil.ReadFile(filepath.Join(t.dir, name))
body, err := os.ReadFile(filepath.Join(t.dir, name))
if err != nil {
return fmt.Errorf("reading config file failed: %w", err)
}
Expand Down Expand Up @@ -359,7 +358,7 @@ func (t *tree) saveConfig(c *config) error {
return err
}

if err = f.Chmod(0644); err != nil {
if err = f.Chmod(0o644); err != nil {
f.Close()
_ = f.Remove()
return fmt.Errorf("save: failed to set permissions: %w", err)
Expand Down Expand Up @@ -391,7 +390,7 @@ type tmpFile interface {

// newTmpFile purely exists to be replaced in tests.
var newTmpFile = func(dir, pattern string) (tmpFile, error) {
f, err := ioutil.TempFile(dir, pattern)
f, err := os.CreateTemp(dir, pattern)
if err != nil {
return nil, fmt.Errorf("failed to create temp file: %w", err)
}
Expand Down

0 comments on commit 5e563b9

Please sign in to comment.