-
Notifications
You must be signed in to change notification settings - Fork 669
Replace context.Background() → t.Context() #3532
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Jan Dubois <jan.dubois@suse.com>
I guess this is an argument to switch to Go 1.24: the |
The linter says that it will disable itself if you run it with an older version? https://golangci-lint.run/usage/linters/#usetesting So I guess the entire sub-linter should be removed, until the go version is bumped i.e. context-background: false |
Makes sense to me; we just need to remember to enable it again when we bump the Go version... |
I think there were three of them (for go1.24), but not sure if we ran into the others Templating the linter config sounds like overkill to me, maybe a reminder comment? |
Is this a real issue? do we need timeouts or cancellation support in the tests? If not the best way is to disable the linter setting or the entire linter. Using all possible linters is not good idea. |
Depends on what you mean by "real".
No
Why not wait until we switch to Go 1.24, apply this PR, and be done with it? |
Sounds good but it does not solve the linter issue. |
Why wouldn't it? That is the main point of the PR... |
How waiting silences the linter? It is not enabled yet and you want to enable it? |
The linter disables itself in 1.23, but will show warnings in 1.24. That's why we can't enable it yet. Because to silence the warnings in 1.24 we have to make use of features that only exist in 1.24, so will break compilation (and linting) in 1.23. But once we stop supporting 1.23 we can apply the changes and enable the linter. It will not show warnings in 1.24 because they will be fixed. This PR makes the changes that require 1.24; it is not compatible with 1.23. |
I recommend that we switch to 1.24 once Lima 1.1.x has shown itself to be stable, e.g. no significant bug reports in the next 2 weeks. We currently can't upgrade our |
I can't reproduce the Details
The issues appear only when I run
Perhaps, in this case, golangci-lint can't determine the Go file version and assumes it's Go 1.24. Could we create a separate issue for upgrading to Go 1.24? That way, we can track all related work and any necessary workarounds in one place. |
To quiet down "usetesting" linter.