Skip to content

Commit a2a50f8

Browse files
committed
Update jsonnet and golangci-lint versions; refactor file reading method
1 parent 9b91b19 commit a2a50f8

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
GIT := git
22
PRE_COMMIT := pre-commit
33

4-
JSONNET_VERSION := v0.18.0
5-
GOLANGCI_VERSION := v1.46.2
4+
JSONNET_VERSION := v0.20.0
5+
GOLANGCI_VERSION := v1.64.6
66

77
VERSION := v0.3.0
88

hooks/jsonnet-fmt-hook/main.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ import (
88
"regexp"
99
"strings"
1010

11-
"io/ioutil"
12-
1311
"golang.org/x/sys/execabs"
1412

1513
"github.com/cybozu/pre-commit-jsonnet/lib"
@@ -157,7 +155,7 @@ func diffJsonnetFmt(f string) (*FileDiff, error) {
157155
return nil, fmtError
158156
}
159157

160-
b, err := ioutil.ReadFile(f)
158+
b, err := os.ReadFile(f)
161159
if err != nil {
162160
return nil, err
163161
}

hooks/jsonnet-lint-hook/main_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ func TestExecJsonnetLint(t *testing.T) {
5252
continue
5353
}
5454

55-
if !errors.As(err, &param.wantErr) {
55+
var lintErr *LintError
56+
if !errors.As(err, &lintErr) {
5657
t.Errorf("args='%q %q', want=%q, got=%q", param.f, param.opts, param.wantErr, err)
5758
}
5859
}

0 commit comments

Comments
 (0)