From d6bc9e814fe9a03fce12f1ee84f415182ae42606 Mon Sep 17 00:00:00 2001 From: david micheneau <47741512+dmicheneau@users.noreply.github.com> Date: Thu, 29 Aug 2024 11:23:49 +0200 Subject: [PATCH] 790 bug golang ci lint (#791) --- .changelog/784.txt | 3 +++ .golangci.yml | 2 +- CHANGELOG.md | 1 - internal/client/client_test.go | 2 -- pkg/utils/utils.go | 1 - 5 files changed, 4 insertions(+), 5 deletions(-) create mode 100644 .changelog/784.txt diff --git a/.changelog/784.txt b/.changelog/784.txt new file mode 100644 index 00000000..6aadea19 --- /dev/null +++ b/.changelog/784.txt @@ -0,0 +1,3 @@ +```release-note:dependency +deps: bump github.com/FrangipaneTeam/terraform-plugin-framework-supertypes from 0.3.1 to 0.4.0 +``` \ No newline at end of file diff --git a/.golangci.yml b/.golangci.yml index 35b0e56d..0ca01f12 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -14,7 +14,7 @@ linters: - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false] - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] - - exportloopref # checks for pointers to enclosing loop variables [fast: false, auto-fix: false] + - copyloopvar # Checks for loop variables that are used in a closure [fast: true, auto-fix: false] - forbidigo # Forbids identifiers [fast: true, auto-fix: false] - gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false] - gocritic # Provides diagnostics that check for bugs, performance and style issues. [fast: false, auto-fix: false] diff --git a/CHANGELOG.md b/CHANGELOG.md index 89600c4d..6ecf3be5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,6 @@ * deps: bump github.com/FrangipaneTeam/terraform-plugin-framework-supertypes from 0.3.1 to 0.4.0 (GH-784) * deps: bump github.com/hashicorp/terraform-plugin-framework from 1.10.0 to 1.11.0 (GH-783) * deps: bump golang.org/x/net from 0.27.0 to 0.28.0 (GH-782) -* deps: bump golang.org/x/net from 0.25.0 to 0.27.0 (GH-780) ## 0.19.0 (August 1, 2024) diff --git a/internal/client/client_test.go b/internal/client/client_test.go index a4dd917e..ce8701e5 100644 --- a/internal/client/client_test.go +++ b/internal/client/client_test.go @@ -96,7 +96,6 @@ func TestCloudAvenueClient(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { t.Parallel() @@ -140,7 +139,6 @@ func TestCloudAvenueClient(t *testing.T) { } for _, tt := range tests { - tt := tt t.Run(tt.name, func(t *testing.T) { c := CloudAvenue{} // Set environment variables for the test diff --git a/pkg/utils/utils.go b/pkg/utils/utils.go index 6ac5656f..416e1515 100644 --- a/pkg/utils/utils.go +++ b/pkg/utils/utils.go @@ -125,7 +125,6 @@ func SliceToSlicePointer[T any](slice []T) []*T { slicePointer := make([]*T, len(slice)) for i, item := range slice { // FIX variable into the local variable for bypassing the pointer aliasing (https://stackoverflow.com/a/64715804) - item := item slicePointer[i] = &item } return slicePointer