Skip to content

Commit

Permalink
🧹: apply all @dependabot's suggested security updates. (#978)
Browse files Browse the repository at this point in the history
* 🧹: 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.
  • Loading branch information
robshakir authored Aug 5, 2024
1 parent fd57413 commit 100bd44
Show file tree
Hide file tree
Showing 15 changed files with 127 additions and 431 deletions.
6 changes: 3 additions & 3 deletions demo/bgp/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -66,9 +66,9 @@ func TestBGPDemo(t *testing.T) {
}}

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

if diff := pretty.Compare(tt.got, string(want)); diff != "" {
Expand Down
6 changes: 3 additions & 3 deletions demo/device/devicedemo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -62,9 +62,9 @@ func TestDeviceDemo(t *testing.T) {
}}

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

if diff := pretty.Compare(tt.got, string(want)); diff != "" {
Expand Down
6 changes: 3 additions & 3 deletions demo/gnmi_telemetry/gnmi_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
Expand Down Expand Up @@ -50,9 +50,9 @@ func TestRenderToGNMINotifications(t *testing.T) {
continue
}

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

want := &gnmipb.Notification{}
Expand Down
6 changes: 3 additions & 3 deletions demo/optical/opticaldemo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -62,9 +62,9 @@ func TestOpticalDemoJSON(t *testing.T) {
}}

for _, tt := range tests {
want, err := ioutil.ReadFile(filepath.Join(TestRoot, "testdata", tt.wantFile))
want, err := os.ReadFile(filepath.Join(TestRoot, "testdata", tt.wantFile))
if err != nil {
t.Errorf("ioutil.ReadFile(%s/testdata/%s): could not open file: %v", TestRoot, tt.wantFile, err)
t.Errorf("os.ReadFile(%s/testdata/%s): could not open file: %v", TestRoot, tt.wantFile, err)
continue
}
if diff := pretty.Compare(tt.got, string(want)); diff != "" {
Expand Down
6 changes: 3 additions & 3 deletions demo/protobuf_getting_started/demo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
package main

import (
"io/ioutil"
"os"
"path/filepath"
"testing"

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

want := &ocpb.Device{}

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

if err := prototext.Unmarshal(wantStr, want); err != nil {
Expand Down
6 changes: 3 additions & 3 deletions demo/uncompressed/uncompressed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ package main

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"

Expand Down Expand Up @@ -63,9 +63,9 @@ func TestUncompressedDemo(t *testing.T) {
}}

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

Expand Down
5 changes: 2 additions & 3 deletions genutil/file_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
package genutil

import (
"io/ioutil"
"os"
"testing"
)

func TestOpenSyncFile(t *testing.T) {
dir, err := ioutil.TempDir(".", "ygot-test-")
dir, err := os.MkdirTemp(".", "ygot-test-")
if err != nil {
t.Fatal(err)
}
Expand All @@ -18,7 +17,7 @@ func TestOpenSyncFile(t *testing.T) {
file.WriteString("42")
SyncFile(file)

bytes, err := ioutil.ReadFile(filename)
bytes, err := os.ReadFile(filename)
if err != nil {
t.Fatal(err)
}
Expand Down
46 changes: 26 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,43 +1,49 @@
module github.com/openconfig/ygot

go 1.18
go 1.21

toolchain go1.22.4

require (
github.com/derekparker/trie v0.0.0-20221221181808-1424fce0c981
github.com/golang/glog v1.2.2
github.com/golang/protobuf v1.5.3
github.com/golang/glog v1.2.1
github.com/golang/protobuf v1.5.4
github.com/google/go-cmp v0.6.0
github.com/kr/pretty v0.3.1
github.com/kylelemons/godebug v1.1.0
github.com/openconfig/gnmi v0.10.0
github.com/openconfig/goyang v1.4.5
github.com/openconfig/gnmi v0.11.0
github.com/openconfig/goyang v1.6.0
github.com/openconfig/gribi v1.0.0
github.com/pmezard/go-difflib v1.0.0
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/spf13/cobra v1.8.0
github.com/spf13/viper v1.15.0
golang.org/x/exp v0.0.0-20230801115018-d63ba01acd4b
google.golang.org/grpc v1.58.0-dev
google.golang.org/protobuf v1.33.0
github.com/spf13/viper v1.19.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
google.golang.org/grpc v1.65.0
google.golang.org/protobuf v1.34.1
)

require (
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/pelletier/go-toml/v2 v2.0.8 // indirect
github.com/pelletier/go-toml/v2 v2.2.2 // indirect
github.com/rogpeppe/go-internal v1.9.0 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/subosito/gotenv v1.4.2 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230525234030-28d5490b6b19 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/net v0.27.0 // indirect
golang.org/x/sys v0.22.0 // indirect
golang.org/x/text v0.16.0 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit 100bd44

Please sign in to comment.