use t.Context() instead of context.Background() for test #195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several updates to the Go version and refactors tests to use the testing context. The most important changes include updating the Go version in the workflow and module files, and refactoring multiple test files to replace
context.Background()
witht.Context()
.Go Version Update:
.github/workflows/go.yml
: Updated the Go version from1.23.x
to1.24.x
in the CI workflow.go.mod
: Updated the Go version from1.23.0
to1.24.0
.Test Refactoring:
internal/cli/cli_test.go
: Refactored theTestUploadSnippet
function to uset.Context()
instead ofcontext.Background()
. [1] [2] [3] [4]internal/slack/client_test.go
: Refactored multiple test functions (TestPostText_Success
,TestPostText_Fail
,TestPostFile_Success
,TestPostFile_FailCallFunc
,TestPostFile_FailAPINotOK
,TestPostFile_FailAPIStatusOK
,TestPostFile_FailBrokenJSON
,TestUploadToURL_success
,TestUploadToURL_fail
,TestCompleteUploadExternal_Success
) to uset.Context()
instead ofcontext.Background()
. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]internal/throttle/exec_test.go
: Refactored theTestRun_pipeClose
andTestRun_contextDone
functions to uset.Context()
instead ofcontext.Background()
. [1] [2]