mirror of
https://github.com/lightningnetwork/lnd.git
synced 2025-11-10 14:17:56 +01:00
multi: context.Background() -> t.Context()
Use the new feature of Go 1.24, fix linter warnings. This change was produced by: - running golangci-lint run --fix - sed 's/context.Background/t.Context/' -i `git grep -l context.Background | grep test.go` - manually fixing broken tests - itest, lntest: use ht.Context() where ht or hn is available - in HarnessNode.Stop() we keep using context.Background(), because it is called from a cleanup handler in which t.Context() is canceled already.
This commit is contained in:
@@ -18,7 +18,7 @@ func TestGoroutineManager(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var (
|
||||
ctx = context.Background()
|
||||
ctx = t.Context()
|
||||
m = NewGoroutineManager()
|
||||
taskChan = make(chan struct{})
|
||||
)
|
||||
@@ -61,7 +61,7 @@ func TestGoroutineManager(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var (
|
||||
ctx = context.Background()
|
||||
ctx = t.Context()
|
||||
m = NewGoroutineManager()
|
||||
taskChan = make(chan struct{})
|
||||
)
|
||||
@@ -114,7 +114,7 @@ func TestGoroutineManager(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
var (
|
||||
ctx = context.Background()
|
||||
ctx = t.Context()
|
||||
m = NewGoroutineManager()
|
||||
stopChan = make(chan struct{})
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user