From 62ac6e495be7842a840128af418702eb4e5d1e1a Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Thu, 5 Oct 2023 09:01:09 -0500 Subject: [PATCH 1/3] chore(lint): fix linter errors --- vela/client.go | 1 + vela/queue.go | 4 +--- vela/queue_test.go | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/vela/client.go b/vela/client.go index 1a555eb..40eb8fe 100644 --- a/vela/client.go +++ b/vela/client.go @@ -57,6 +57,7 @@ type ( } service struct { + //nolint:structcheck // false positive client *Client } diff --git a/vela/queue.go b/vela/queue.go index 903de32..6c2c442 100644 --- a/vela/queue.go +++ b/vela/queue.go @@ -1,6 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. +// SPDX-License-Identifier: Apache-2.0 package vela diff --git a/vela/queue_test.go b/vela/queue_test.go index 7a1416a..589c223 100644 --- a/vela/queue_test.go +++ b/vela/queue_test.go @@ -1,6 +1,4 @@ -// Copyright (c) 2022 Target Brands, Inc. All rights reserved. -// -// Use of this source code is governed by the LICENSE file in this repository. +// SPDX-License-Identifier: Apache-2.0 package vela From ae4537f863ce13bb25ef648cda5dffc934456d65 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Thu, 5 Oct 2023 14:04:06 -0500 Subject: [PATCH 2/3] test(fix): fix gosec linter error --- vela/schedule_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/vela/schedule_test.go b/vela/schedule_test.go index 675ad4a..27d53fe 100644 --- a/vela/schedule_test.go +++ b/vela/schedule_test.go @@ -12,6 +12,7 @@ import ( "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" + "github.com/google/go-cmp/cmp" ) func TestSchedule_Get(t *testing.T) { @@ -146,8 +147,8 @@ func TestSchedule_GetAll(t *testing.T) { t.Errorf("GetAll for %s is %v, want %v", test.name, gotResp.StatusCode, test.wantResp) } - if !reflect.DeepEqual(got, &test.want) { - t.Errorf("GetAll for %s is %v, want %v", test.name, *got, test.want) + if cmp.Equal(got, test.want) { + t.Errorf("GetAll for %s is %v, want %v", test.name, got, test.want) } }) } From 62d3434de83408adb8cb80f609c6951a3a6a31d9 Mon Sep 17 00:00:00 2001 From: wass3r <1301201+wass3r@users.noreply.github.com> Date: Thu, 5 Oct 2023 16:04:13 -0500 Subject: [PATCH 3/3] like, actually fix the test --- vela/schedule_test.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/vela/schedule_test.go b/vela/schedule_test.go index 27d53fe..f0e3874 100644 --- a/vela/schedule_test.go +++ b/vela/schedule_test.go @@ -12,7 +12,6 @@ import ( "github.com/go-vela/server/mock/server" "github.com/go-vela/types/library" - "github.com/google/go-cmp/cmp" ) func TestSchedule_Get(t *testing.T) { @@ -147,7 +146,7 @@ func TestSchedule_GetAll(t *testing.T) { t.Errorf("GetAll for %s is %v, want %v", test.name, gotResp.StatusCode, test.wantResp) } - if cmp.Equal(got, test.want) { + if !reflect.DeepEqual(*got, test.want) { t.Errorf("GetAll for %s is %v, want %v", test.name, got, test.want) } })