Skip to content

Commit 100bd44

Browse files
authored
🧹: apply all @dependabot's suggested security updates. (#978)
* 🧹: apply all @dependabot's suggested security updates. * (M) go.{mod,sum} - Update all packages that @dependabot suggests we update. * Address static analysis failures. * Update to latest goyang release. * Housekeeping. * Fix static errors. * More `ioutil` removal.
1 parent fd57413 commit 100bd44

File tree

15 files changed

+127
-431
lines changed

15 files changed

+127
-431
lines changed

demo/bgp/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package main
1616

1717
import (
18-
"io/ioutil"
18+
"os"
1919
"path/filepath"
2020
"testing"
2121

@@ -66,9 +66,9 @@ func TestBGPDemo(t *testing.T) {
6666
}}
6767

6868
for _, tt := range tests {
69-
want, ioerr := ioutil.ReadFile(filepath.Join(TestRoot, tt.wantFile))
69+
want, ioerr := os.ReadFile(filepath.Join(TestRoot, tt.wantFile))
7070
if ioerr != nil {
71-
t.Fatalf("TestBGPDemo %s: ioutil.ReadFile(%s/%s): could not open file: %v", tt.name, TestRoot, tt.wantFile, ioerr)
71+
t.Fatalf("TestBGPDemo %s: os.ReadFile(%s/%s): could not open file: %v", tt.name, TestRoot, tt.wantFile, ioerr)
7272
}
7373

7474
if diff := pretty.Compare(tt.got, string(want)); diff != "" {

demo/device/devicedemo_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package main
1616

1717
import (
18-
"io/ioutil"
18+
"os"
1919
"path/filepath"
2020
"testing"
2121

@@ -62,9 +62,9 @@ func TestDeviceDemo(t *testing.T) {
6262
}}
6363

6464
for _, tt := range tests {
65-
want, ioerr := ioutil.ReadFile(filepath.Join(TestRoot, tt.wantFile))
65+
want, ioerr := os.ReadFile(filepath.Join(TestRoot, tt.wantFile))
6666
if ioerr != nil {
67-
t.Fatalf("%s: TestDeviceDemo: ioutil.ReadFile(%s/%s): could not open file: %v", tt.name, TestRoot, tt.wantFile, ioerr)
67+
t.Fatalf("%s: TestDeviceDemo: os.ReadFile(%s/%s): could not open file: %v", tt.name, TestRoot, tt.wantFile, ioerr)
6868
}
6969

7070
if diff := pretty.Compare(tt.got, string(want)); diff != "" {

demo/gnmi_telemetry/gnmi_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package main
22

33
import (
4-
"io/ioutil"
4+
"os"
55
"path/filepath"
66
"strings"
77
"testing"
@@ -50,9 +50,9 @@ func TestRenderToGNMINotifications(t *testing.T) {
5050
continue
5151
}
5252

53-
wantData, err := ioutil.ReadFile(tt.wantProtoFile)
53+
wantData, err := os.ReadFile(tt.wantProtoFile)
5454
if err != nil {
55-
t.Errorf("%s: ioutil.ReadFile(%v): could not read protobuf testdata file", tt.name, tt.wantProtoFile)
55+
t.Errorf("%s: os.ReadFile(%v): could not read protobuf testdata file", tt.name, tt.wantProtoFile)
5656
}
5757

5858
want := &gnmipb.Notification{}

demo/optical/opticaldemo_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
package main
1616

1717
import (
18-
"io/ioutil"
18+
"os"
1919
"path/filepath"
2020
"testing"
2121

@@ -62,9 +62,9 @@ func TestOpticalDemoJSON(t *testing.T) {
6262
}}
6363

6464
for _, tt := range tests {
65-
want, err := ioutil.ReadFile(filepath.Join(TestRoot, "testdata", tt.wantFile))
65+
want, err := os.ReadFile(filepath.Join(TestRoot, "testdata", tt.wantFile))
6666
if err != nil {
67-
t.Errorf("ioutil.ReadFile(%s/testdata/%s): could not open file: %v", TestRoot, tt.wantFile, err)
67+
t.Errorf("os.ReadFile(%s/testdata/%s): could not open file: %v", TestRoot, tt.wantFile, err)
6868
continue
6969
}
7070
if diff := pretty.Compare(tt.got, string(want)); diff != "" {

demo/protobuf_getting_started/demo_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
package main
1717

1818
import (
19-
"io/ioutil"
19+
"os"
2020
"path/filepath"
2121
"testing"
2222

@@ -55,9 +55,9 @@ func TestProtoGenerate(t *testing.T) {
5555

5656
want := &ocpb.Device{}
5757

58-
wantStr, err := ioutil.ReadFile(filepath.Join("testdata", tt.wantTextProto))
58+
wantStr, err := os.ReadFile(filepath.Join("testdata", tt.wantTextProto))
5959
if err != nil {
60-
t.Errorf("%s: ioutil.ReadFile(testdata/%s): could not read file, got: %v, want: nil", tt.name, tt.wantTextProto, err)
60+
t.Errorf("%s: os.ReadFile(testdata/%s): could not read file, got: %v, want: nil", tt.name, tt.wantTextProto, err)
6161
}
6262

6363
if err := prototext.Unmarshal(wantStr, want); err != nil {

demo/uncompressed/uncompressed_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ package main
1616

1717
import (
1818
"fmt"
19-
"io/ioutil"
19+
"os"
2020
"path/filepath"
2121
"testing"
2222

@@ -63,9 +63,9 @@ func TestUncompressedDemo(t *testing.T) {
6363
}}
6464

6565
for _, tt := range tests {
66-
want, ioerr := ioutil.ReadFile(filepath.Join(TestRoot, tt.wantFile))
66+
want, ioerr := os.ReadFile(filepath.Join(TestRoot, tt.wantFile))
6767
if ioerr != nil {
68-
t.Errorf("%s: ioutil.ReadFile(%s/%s): error reading file, got: %v, want: nil", tt.name, TestRoot, tt.wantFile, ioerr)
68+
t.Errorf("%s: os.ReadFile(%s/%s): error reading file, got: %v, want: nil", tt.name, TestRoot, tt.wantFile, ioerr)
6969
continue
7070
}
7171

genutil/file_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package genutil
22

33
import (
4-
"io/ioutil"
54
"os"
65
"testing"
76
)
87

98
func TestOpenSyncFile(t *testing.T) {
10-
dir, err := ioutil.TempDir(".", "ygot-test-")
9+
dir, err := os.MkdirTemp(".", "ygot-test-")
1110
if err != nil {
1211
t.Fatal(err)
1312
}
@@ -18,7 +17,7 @@ func TestOpenSyncFile(t *testing.T) {
1817
file.WriteString("42")
1918
SyncFile(file)
2019

21-
bytes, err := ioutil.ReadFile(filename)
20+
bytes, err := os.ReadFile(filename)
2221
if err != nil {
2322
t.Fatal(err)
2423
}

go.mod

+26-20
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,49 @@
11
module github.com/openconfig/ygot
22

3-
go 1.18
3+
go 1.21
4+
5+
toolchain go1.22.4
46

57
require (
68
github.com/derekparker/trie v0.0.0-20221221181808-1424fce0c981
7-
github.com/golang/glog v1.2.2
8-
github.com/golang/protobuf v1.5.3
9+
github.com/golang/glog v1.2.1
10+
github.com/golang/protobuf v1.5.4
911
github.com/google/go-cmp v0.6.0
1012
github.com/kr/pretty v0.3.1
1113
github.com/kylelemons/godebug v1.1.0
12-
github.com/openconfig/gnmi v0.10.0
13-
github.com/openconfig/goyang v1.4.5
14+
github.com/openconfig/gnmi v0.11.0
15+
github.com/openconfig/goyang v1.6.0
1416
github.com/openconfig/gribi v1.0.0
15-
github.com/pmezard/go-difflib v1.0.0
17+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
1618
github.com/spf13/cobra v1.8.0
17-
github.com/spf13/viper v1.15.0
18-
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
19-
google.golang.org/grpc v1.58.0-dev
20-
google.golang.org/protobuf v1.33.0
19+
github.com/spf13/viper v1.19.0
20+
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
21+
google.golang.org/grpc v1.65.0
22+
google.golang.org/protobuf v1.34.1
2123
)
2224

2325
require (
24-
github.com/fsnotify/fsnotify v1.6.0 // indirect
26+
github.com/fsnotify/fsnotify v1.7.0 // indirect
2527
github.com/hashicorp/hcl v1.0.0 // indirect
2628
github.com/inconshreveable/mousetrap v1.1.0 // indirect
2729
github.com/kr/text v0.2.0 // indirect
2830
github.com/magiconair/properties v1.8.7 // indirect
2931
github.com/mitchellh/mapstructure v1.5.0 // indirect
30-
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
32+
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
3133
github.com/rogpeppe/go-internal v1.9.0 // indirect
32-
github.com/spf13/afero v1.9.5 // indirect
33-
github.com/spf13/cast v1.5.1 // indirect
34-
github.com/spf13/jwalterweatherman v1.1.0 // indirect
34+
github.com/sagikazarmark/locafero v0.4.0 // indirect
35+
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
36+
github.com/sourcegraph/conc v0.3.0 // indirect
37+
github.com/spf13/afero v1.11.0 // indirect
38+
github.com/spf13/cast v1.6.0 // indirect
3539
github.com/spf13/pflag v1.0.5 // indirect
36-
github.com/subosito/gotenv v1.4.2 // indirect
37-
golang.org/x/net v0.17.0 // indirect
38-
golang.org/x/sys v0.13.0 // indirect
39-
golang.org/x/text v0.13.0 // indirect
40-
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
40+
github.com/subosito/gotenv v1.6.0 // indirect
41+
go.uber.org/atomic v1.9.0 // indirect
42+
go.uber.org/multierr v1.9.0 // indirect
43+
golang.org/x/net v0.27.0 // indirect
44+
golang.org/x/sys v0.22.0 // indirect
45+
golang.org/x/text v0.16.0 // indirect
46+
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
4147
gopkg.in/ini.v1 v1.67.0 // indirect
4248
gopkg.in/yaml.v3 v3.0.1 // indirect
4349
)

0 commit comments

Comments
 (0)