diff --git a/.github/actions/lint-provider-tfe/action.yml b/.github/actions/lint-provider-tfe/action.yml index 7a9136320..7d350beae 100644 --- a/.github/actions/lint-provider-tfe/action.yml +++ b/.github/actions/lint-provider-tfe/action.yml @@ -21,10 +21,10 @@ runs: shell: bash - name: Install golangci-lint - run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/0b5709648c8ba9780e821faf16c5c2bb3262ce3e/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCILINT_VERSION + run: curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/c1149695535fda62f6b574bc55dfbc333693647e/install.sh | sh -s -- -b $(go env GOPATH)/bin $GOLANGCILINT_VERSION shell: bash env: - GOLANGCILINT_VERSION: v1.55.2 + GOLANGCILINT_VERSION: v1.63.4 - run: make lint shell: bash diff --git a/.golangci.yml b/.golangci.yml index b777cc1a8..3ad22ced6 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -103,7 +103,7 @@ issues: - linters: - staticcheck path: resource_tfe_workspace_run_task\.go - text: "SA1019: v.Stage is deprecated: Use Stages property instead" + text: "SA1019: v.Stage is deprecated: Use Stages property instead" linters-settings: # errcheck: # # https://github.com/kisielk/errcheck#excluding-functions @@ -125,7 +125,6 @@ linters-settings: - singleCaseSwitch - ifElseChain - nestingReduce - - sloppyTestFuncName revive: # see https://github.com/mgechev/revive#available-rules for details. ignore-generated-header: false #recommended in their configuration diff --git a/go.mod b/go.mod index cadc02116..c5e263211 100644 --- a/go.mod +++ b/go.mod @@ -2,8 +2,6 @@ module github.com/hashicorp/terraform-provider-tfe go 1.22.0 -toolchain go1.23.3 - require ( github.com/agext/levenshtein v1.2.3 // indirect github.com/fatih/color v1.18.0 // indirect diff --git a/internal/provider/workspace_run_helpers.go b/internal/provider/workspace_run_helpers.go index 0d0ec5c02..18638c6e3 100644 --- a/internal/provider/workspace_run_helpers.go +++ b/internal/provider/workspace_run_helpers.go @@ -420,10 +420,10 @@ func readRunPositionInWorkspaceQueue(tfeClient *tfe.Client, runID string, wsID s // perform exponential backoff based on the iteration and // limited by the provided min and max durations in milliseconds. -func backoff(min, max float64, iter int) time.Duration { - backoff := math.Pow(2, float64(iter)/5) * min - if backoff > max { - backoff = max +func backoff(minVal float64, maxVal float64, iter int) time.Duration { + backoff := math.Pow(2, float64(iter)/5) * minVal + if backoff > maxVal { + backoff = maxVal } return time.Duration(backoff) * time.Millisecond }