Skip to content

Commit

Permalink
Upgrade golangci-lint, address errors
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasslash committed Jan 29, 2025
1 parent 696e845 commit b874085
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/actions/lint-provider-tfe/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions internal/provider/workspace_run_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit b874085

Please sign in to comment.