Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

golangci-lint: enable fatcontext and canonicalheader #3902

Merged
merged 1 commit into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ issues:
# files (due to common repeats and long functions in test code)
- path: _(test|gen)\.go
linters:
- canonicalheader
- cyclop
- dupl
- gocognit
Expand Down Expand Up @@ -68,6 +69,7 @@ linters:
- asciicheck
- bidichk
- bodyclose
- canonicalheader
- contextcheck
- cyclop
- dogsled
Expand All @@ -79,6 +81,7 @@ linters:
- errorlint
- exhaustive
- exportloopref
- fatcontext
- forbidigo
- forcetypeassert
- funlen
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const (
// MaxRetries specifies max retry attempts
MaxRetries = 3

k6IdempotencyKeyHeader = "k6-Idempotency-Key"
k6IdempotencyKeyHeader = "K6-Idempotency-Key"
)

// Client handles communication with the k6 Cloud API.
Expand Down
2 changes: 1 addition & 1 deletion cloudapi/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ func (c *Config) logtailConn(ctx context.Context, referenceID string, since time
headers := make(http.Header)
headers.Add("Sec-WebSocket-Protocol", "token="+c.Token.String)
headers.Add("Authorization", "token "+c.Token.String)
headers.Add("X-K6TestRun-Id", referenceID)
headers.Add("X-K6testrun-Id", referenceID)

var conn *websocket.Conn
err = retry(sleeperFunc(time.Sleep), 3, 5*time.Second, 2*time.Minute, func() (err error) {
Expand Down
2 changes: 1 addition & 1 deletion lib/executor/vu_handle.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func (vh *vuHandle) runLoopsIfPossible(runIter func(context.Context, lib.ActiveV
// we need to cancel the context, to return the vu
// and because *we* did, lets reinitialize it
cancel()
vh.ctx, vh.cancel = context.WithCancel(vh.parentCtx)
vh.ctx, vh.cancel = context.WithCancel(vh.parentCtx) //nolint:fatcontext // isn't actually on the same context
}
fallthrough // to set the state
case toHardStop:
Expand Down