From 238076f0db81cf3b824007736da1d5a43b988069 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Feb 2024 04:06:34 +0000 Subject: [PATCH] build(deps): bump go.einride.tech/sage from 0.265.1 to 0.268.0 in /.sage Bumps [go.einride.tech/sage](https://github.com/einride/sage) from 0.265.1 to 0.268.0. - [Release notes](https://github.com/einride/sage/releases) - [Commits](https://github.com/einride/sage/compare/v0.265.1...v0.268.0) --- updated-dependencies: - dependency-name: go.einride.tech/sage dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .sage/go.mod | 2 +- .sage/go.sum | 4 ++-- cmd/cantool/main.go | 6 +++--- data_test.go | 8 ++++---- frame_json.go | 2 ++ internal/generate/example_test.go | 2 +- internal/generate/file.go | 1 + pkg/socketcan/transmitter_test.go | 2 +- 8 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.sage/go.mod b/.sage/go.mod index 3c06e95d..d5791ee4 100644 --- a/.sage/go.mod +++ b/.sage/go.mod @@ -2,4 +2,4 @@ module go.einride.tech/can/.sage go 1.19 -require go.einride.tech/sage v0.265.1 +require go.einride.tech/sage v0.268.0 diff --git a/.sage/go.sum b/.sage/go.sum index 565e8e3e..87a80c83 100644 --- a/.sage/go.sum +++ b/.sage/go.sum @@ -1,2 +1,2 @@ -go.einride.tech/sage v0.265.1 h1:q3vZbehb1EqxjY2IsJNjIayBjBHU/uKD96fDz22rauM= -go.einride.tech/sage v0.265.1/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= +go.einride.tech/sage v0.268.0 h1:/NKvKzhIis1izBHPwK4YbRWYLL5+q+oVOANt8Z7snWA= +go.einride.tech/sage v0.268.0/go.mod h1:EzV5uciFX7/2ho8EKB5K9JghOfXIxlzs694b+Tkl5GQ= diff --git a/cmd/cantool/main.go b/cmd/cantool/main.go index 433dacdc..d0468aea 100644 --- a/cmd/cantool/main.go +++ b/cmd/cantool/main.go @@ -51,7 +51,7 @@ func generateCommand(app *kingpin.Application) { Arg("output-dir", "output directory"). Required(). String() - command.Action(func(c *kingpin.ParseContext) error { + command.Action(func(_ *kingpin.ParseContext) error { return filepath.Walk(*inputDir, func(p string, i os.FileInfo, err error) error { if err != nil { return err @@ -76,7 +76,7 @@ func lintCommand(app *kingpin.Application) { Arg("file-or-dir", "DBC file or directory"). Required(). ExistingFileOrDir() - command.Action(func(context *kingpin.ParseContext) error { + command.Action(func(_ *kingpin.ParseContext) error { filesToLint, err := resolveFileOrDirectory(*fileOrDir) if err != nil { return err @@ -176,7 +176,7 @@ func resolveFileOrDirectory(fileOrDirectory string) ([]string, error) { return []string{fileOrDirectory}, nil } var files []string - if err := filepath.Walk(fileOrDirectory, func(path string, info os.FileInfo, err error) error { + if err := filepath.Walk(fileOrDirectory, func(path string, info os.FileInfo, _ error) error { if !info.IsDir() && filepath.Ext(path) == ".dbc" { files = append(files, path) } diff --git a/data_test.go b/data_test.go index 752c2a7f..de42d63d 100644 --- a/data_test.go +++ b/data_test.go @@ -150,7 +150,7 @@ func TestData_LittleEndian(t *testing.T) { var data Data for j, signal := range tt.signals { j, signal := j, signal - t.Run(fmt.Sprintf("data:%v", j), func(t *testing.T) { + t.Run(fmt.Sprintf("data:%v", j), func(_ *testing.T) { data.SetUnsignedBitsLittleEndian(signal.start, signal.length, signal.unsigned) }) } @@ -160,7 +160,7 @@ func TestData_LittleEndian(t *testing.T) { var data Data for j, signal := range tt.signals { j, signal := j, signal - t.Run(fmt.Sprintf("data:%v", j), func(t *testing.T) { + t.Run(fmt.Sprintf("data:%v", j), func(_ *testing.T) { data.SetSignedBitsLittleEndian(signal.start, signal.length, signal.signed) }) } @@ -251,7 +251,7 @@ func TestData_BigEndian(t *testing.T) { var data Data for j, signal := range tt.signals { j, signal := j, signal - t.Run(fmt.Sprintf("data:%v", j), func(t *testing.T) { + t.Run(fmt.Sprintf("data:%v", j), func(_ *testing.T) { data.SetUnsignedBitsBigEndian(signal.start, signal.length, signal.unsigned) }) } @@ -261,7 +261,7 @@ func TestData_BigEndian(t *testing.T) { var data Data for j, signal := range tt.signals { j, signal := j, signal - t.Run(fmt.Sprintf("data:%v", j), func(t *testing.T) { + t.Run(fmt.Sprintf("data:%v", j), func(_ *testing.T) { data.SetSignedBitsBigEndian(signal.start, signal.length, signal.signed) }) } diff --git a/frame_json.go b/frame_json.go index e14ced63..043cd9de 100644 --- a/frame_json.go +++ b/frame_json.go @@ -21,6 +21,8 @@ type jsonFrame struct { // // {"id":32,"data":"0102030405060708"} // {"id":32,"extended":true,"remote":true,"length":4} +// +//nolint:goconst func (f Frame) JSON() string { switch { case f.IsRemote && f.IsExtended: diff --git a/internal/generate/example_test.go b/internal/generate/example_test.go index 99e412a3..b095ee02 100644 --- a/internal/generate/example_test.go +++ b/internal/generate/example_test.go @@ -309,7 +309,7 @@ func TestExample_Node_NoEmptyMessages(t *testing.T) { motor := examplecan.NewMOTOR("can", "vcan0") // when starting them ctx, cancel := context.WithTimeout(context.Background(), testTimeout) - handler := func(ctx context.Context) error { + handler := func(_ context.Context) error { motor.Lock() motor.Tx().MotorStatus().SetSpeedKph(100).SetWheelError(true) motor.Unlock() diff --git a/internal/generate/file.go b/internal/generate/file.go index 8f10a352..3f9d3000 100644 --- a/internal/generate/file.go +++ b/internal/generate/file.go @@ -749,6 +749,7 @@ func txGroupInterface(n *descriptor.Node) string { return n.Name + "_Tx" } +//nolint:goconst func txGroupStruct(n *descriptor.Node) string { return "xxx_" + n.Name + "_Tx" } diff --git a/pkg/socketcan/transmitter_test.go b/pkg/socketcan/transmitter_test.go index 25b7bb35..3539dd22 100644 --- a/pkg/socketcan/transmitter_test.go +++ b/pkg/socketcan/transmitter_test.go @@ -53,7 +53,7 @@ func TestTransmitter_TransmitMessage(t *testing.T) { // Frame Interceptor run := false - intFunc := func(fr can.Frame) { + intFunc := func(_ can.Frame) { run = true } testTransmit(TransmitterFrameInterceptor(intFunc))