diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index d8b70dd0..09bbfb6b 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -42,6 +42,6 @@ jobs: if: ${{ steps.filter.outputs.go == 'true' || steps.filter.outputs.linter == 'true'}} uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7 with: - version: v2.0.2 # renovate: depName=golangci/golangci-lint datasource=github-releases + version: v2.1.2 # renovate: depName=golangci/golangci-lint datasource=github-releases skip-cache: true args: -v --timeout=10m diff --git a/.golangci.yml b/.golangci.yml index 9a21cc07..6c21625d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -9,6 +9,7 @@ linters: - exhaustruct - forcetypeassert - funlen + - funcorder # nice to have, but currently generating too many errors - gocognit - gocyclo - ireturn diff --git a/Makefile b/Makefile index 5a19fceb..3c6a13b6 100644 --- a/Makefile +++ b/Makefile @@ -3,7 +3,7 @@ TARGETS=darwin linux windows TERRAFORM_PLUGIN_EXTENSION= VERSION=0.75.0# x-release-please-version -GOLANGCI_LINT_VERSION=v2.0.2# renovate: depName=golangci/golangci-lint datasource=github-releases +GOLANGCI_LINT_VERSION=v2.1.2# renovate: depName=golangci/golangci-lint datasource=github-releases # check if opentofu is installed and use it if it is, # otherwise use terraform @@ -113,7 +113,7 @@ testacc: lint: # NOTE: This target is for local runs only. For linting in CI see .github/workflows/golangci-lint.yml @docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION):/root/.cache -w /app golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint fmt - @docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION):/root/.cache -w /app golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint run + @docker run -t --rm -v $$(pwd):/app -v ~/.cache/golangci-lint/$(GOLANGCI_LINT_VERSION):/root/.cache -w /app golangci/golangci-lint:$(GOLANGCI_LINT_VERSION) golangci-lint run --fix .PHONY: release-build release-build: diff --git a/proxmox/ssh/client.go b/proxmox/ssh/client.go index cab0e787..e6c022c8 100644 --- a/proxmox/ssh/client.go +++ b/proxmox/ssh/client.go @@ -336,7 +336,7 @@ func (c *client) NodeStreamUpload( if d.Mode != "" { parsedFileMode, parseErr := strconv.ParseUint(d.Mode, 8, 12) if parseErr != nil { - return fmt.Errorf("failed to parse file mode %q: %w", d.Mode, err) + return fmt.Errorf("failed to parse file mode %q: %w", d.Mode, parseErr) } mode := uint32(parsedFileMode) diff --git a/proxmoxtf/resource/vm/vm.go b/proxmoxtf/resource/vm/vm.go index d4dcfe04..100acc3c 100644 --- a/proxmoxtf/resource/vm/vm.go +++ b/proxmoxtf/resource/vm/vm.go @@ -3857,7 +3857,7 @@ func vmReadCustom( // from the default qcow2, so we need to read it from the storage API to make sure we have the correct value volume, err := client.Node(nodeName).Storage(fileIDParts[0]).GetDatastoreFile(ctx, vmConfig.EFIDisk.FileVolume) if err != nil { - diags = append(diags, diag.FromErr(e)...) + diags = append(diags, diag.FromErr(err)...) } else { efiDisk[mkEFIDiskFileFormat] = volume.FileFormat }