From c5177de232bc90685d701c1320bb42f99049674b Mon Sep 17 00:00:00 2001 From: renovate_bot <group_8045_bot_c14af90fcc2e9e0c89e91dd630ad2f8d@noreply.code.fbi.h-da.de> Date: Tue, 12 Nov 2024 08:18:53 +0000 Subject: [PATCH] [renovate] Update golangci/golangci-lint Docker tag to v1.62.0 See merge request danet/gosdn!1100 Co-authored-by: Fabian Seidl <fabian.seidl@h-da.de> Co-authored-by: Renovate Bot <renovate@danet.fbi.h-da.de> --- .gitlab/ci/.code-quality-ci.yml | 2 +- Makefile | 2 +- .../models/model-handling.go | 2 +- .../venv-manager/yang-parser/yang-parser.go | 2 +- controller/northbound/server/pnd_test.go | 4 +-- controller/nucleus/gnmi_transport_test.go | 34 +++++++++---------- .../nucleus/pluginFilesystemStore_test.go | 4 +-- csbi/write.go | 2 +- .../networkElement_tests/modelUtility_test.go | 2 +- plugins/sdk/deviceModel.go | 2 +- 10 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.gitlab/ci/.code-quality-ci.yml b/.gitlab/ci/.code-quality-ci.yml index 325bd0e1d..af2755eb1 100644 --- a/.gitlab/ci/.code-quality-ci.yml +++ b/.gitlab/ci/.code-quality-ci.yml @@ -1,5 +1,5 @@ code-quality: - image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v1.61.0-alpine + image: ${CI_DEPENDENCY_PROXY_GROUP_IMAGE_PREFIX}/golangci/golangci-lint:v1.62.0-alpine stage: analyze script: # writes golangci-lint output to gl-code-quality-report.json diff --git a/Makefile b/Makefile index 083a9087d..888644abe 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ PLUGIN_NAME= bundled_plugin.zip # Tool Versions GOTESTSUM_VERSION=v1.8.1 -GOLANGCI_LINT_VERSION=v1.60.2 +GOLANGCI_LINT_VERSION=v1.62.0 MOCKERY_VERSION=v2.20.0 YGOT_GENERATOR_VERSION=v0.27.0 YGOT_GENERATOR_GENERATOR_VERSION=v0.0.4 diff --git a/application-framework/models/model-handling.go b/application-framework/models/model-handling.go index 016406ced..c2d08ab56 100644 --- a/application-framework/models/model-handling.go +++ b/application-framework/models/model-handling.go @@ -45,7 +45,7 @@ func Unmarshal(bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytyp func unmarshal(schema *ytypes.Schema, bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytypes.UnmarshalOpt) error { defer func() { if r := recover(); r != nil { - log.Error(r.(error)) + log.Error(r.(error)) //nolint:errcheck } }() diff --git a/applications/venv-manager/yang-parser/yang-parser.go b/applications/venv-manager/yang-parser/yang-parser.go index b6da0b842..dc98e72f0 100644 --- a/applications/venv-manager/yang-parser/yang-parser.go +++ b/applications/venv-manager/yang-parser/yang-parser.go @@ -25,7 +25,7 @@ func Unmarshal(bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytyp func unmarshal(schema *ytypes.Schema, bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytypes.UnmarshalOpt) error { defer func() { if r := recover(); r != nil { - fmt.Println(r.(error)) + fmt.Println(r.(error)) //nolint:errcheck } }() diff --git a/controller/northbound/server/pnd_test.go b/controller/northbound/server/pnd_test.go index 36944290b..bc42ffce0 100644 --- a/controller/northbound/server/pnd_test.go +++ b/controller/northbound/server/pnd_test.go @@ -58,8 +58,8 @@ func getTestPndServer(t *testing.T) *PndServer { UUID: mneUUID, } - mockNetworkElement.(*nucleus.CommonNetworkElement).SetTransport(&mocks.Transport{}) - mockNetworkElement.(*nucleus.CommonNetworkElement).SetName(hostname) + mockNetworkElement.(*nucleus.CommonNetworkElement).SetTransport(&mocks.Transport{}) //nolint:errcheck + mockNetworkElement.(*nucleus.CommonNetworkElement).SetName(hostname) //nolint:errcheck mockChange := &mocks.Change{} mockChange.On("Age").Return(time.Hour) diff --git a/controller/nucleus/gnmi_transport_test.go b/controller/nucleus/gnmi_transport_test.go index e7230b1af..d8aaf9e59 100644 --- a/controller/nucleus/gnmi_transport_test.go +++ b/controller/nucleus/gnmi_transport_test.go @@ -47,12 +47,12 @@ func TestGnmi_Capabilities(t *testing.T) { capabilityRequest := &gpb.CapabilityRequest{} - transport.client.(*mocks.GNMIClient). - On("NewContext", mockContext, mock.Anything). - Return(mockContext) - transport.client.(*mocks.GNMIClient). - On("Capabilities", mockContext, capabilityRequest). - Return(capabilityResponse, nil) + transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("NewContext", mockContext, mock.Anything). + Return(mockContext) + transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("Capabilities", mockContext, capabilityRequest). + Return(capabilityResponse, nil) type fields struct { transport *Gnmi @@ -142,15 +142,15 @@ func TestGnmi_Get(t *testing.T) { Extension: nil, } - transport.client.(*mocks.GNMIClient). - On("NewContext", mockContext, mock.Anything). - Return(mockContext) - transport.client.(*mocks.GNMIClient). - On("NewGetRequest", mockContext, mock.Anything, mock.Anything). - Return(getRequest, nil) - transport.client.(*mocks.GNMIClient). - On("Get", mockContext, mock.Anything). - Return(getResponse, nil) + transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("NewContext", mockContext, mock.Anything). + Return(mockContext) + transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("NewGetRequest", mockContext, mock.Anything, mock.Anything). + Return(getRequest, nil) + transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("Get", mockContext, mock.Anything). + Return(getResponse, nil) type fields struct { transport *Gnmi @@ -357,8 +357,8 @@ func TestGnmi_Set(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - tt.fields.transport.client.(*mocks.GNMIClient). - On("Set", mockContext, tt.fields.mockArgumentMatcher).Return(setResponse, nil) + tt.fields.transport.client.(*mocks.GNMIClient). //nolint:errcheck + On("Set", mockContext, tt.fields.mockArgumentMatcher).Return(setResponse, nil) err := tt.fields.transport.Set(tt.args.ctx, tt.args.payload) if (err != nil) != tt.wantErr { t.Errorf("Set() error = %v, wantErr %v", err, tt.wantErr) diff --git a/controller/nucleus/pluginFilesystemStore_test.go b/controller/nucleus/pluginFilesystemStore_test.go index 06b6a0a0c..1745dee2a 100644 --- a/controller/nucleus/pluginFilesystemStore_test.go +++ b/controller/nucleus/pluginFilesystemStore_test.go @@ -124,9 +124,9 @@ func TestDeleteAllPlugins(t *testing.T) { t.Error(err) } mockPlugin1 := mockPlugin(t) - mockPlugin1.(*mocks.Plugin).On("ID").Return(mockPlugin1ID) + mockPlugin1.(*mocks.Plugin).On("ID").Return(mockPlugin1ID) //nolint:errcheck mockPlugin2 := mockPlugin(t) - mockPlugin2.(*mocks.Plugin).On("ID").Return(mockPlugin2ID) + mockPlugin2.(*mocks.Plugin).On("ID").Return(mockPlugin2ID) //nolint:errcheck inputPlugins := [2]plugin.Plugin{mockPlugin1, mockPlugin2} diff --git a/csbi/write.go b/csbi/write.go index b9ed31815..b005afb52 100644 --- a/csbi/write.go +++ b/csbi/write.go @@ -27,7 +27,7 @@ import ( // The output includes a package header which is generated. func write(ctx context.Context, code *gogen.GeneratedCode, path string, sbiType spb.Type) error { if err := os.Mkdir(path, 0755); err != nil { - if err.(*fs.PathError).Err.Error() != "file exists" { //nolint:errorlint + if err.(*fs.PathError).Err.Error() != "file exists" { //nolint:errorlint,errcheck return err } } diff --git a/integration-tests/networkElement_tests/modelUtility_test.go b/integration-tests/networkElement_tests/modelUtility_test.go index 1e87c02ad..fd8b2b226 100644 --- a/integration-tests/networkElement_tests/modelUtility_test.go +++ b/integration-tests/networkElement_tests/modelUtility_test.go @@ -39,7 +39,7 @@ func Unmarshal(bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytyp func unmarshal(schema *ytypes.Schema, bytes []byte, path *gpb.Path, goStruct ygot.GoStruct, opt ...ytypes.UnmarshalOpt) error { defer func() { if r := recover(); r != nil { - logrus.Error(r.(error)) + logrus.Error(r.(error)) //nolint:errcheck } }() diff --git a/plugins/sdk/deviceModel.go b/plugins/sdk/deviceModel.go index 710ee23dd..a74960054 100644 --- a/plugins/sdk/deviceModel.go +++ b/plugins/sdk/deviceModel.go @@ -65,7 +65,7 @@ func unmarshal( opt ...ytypes.UnmarshalOpt) error { defer func() { if r := recover(); r != nil { - log.Error(r.(error)) + log.Error(r.(error)) //nolint:errcheck } }() -- GitLab