mirror of
https://github.com/Crocmagnon/fatcontext.git
synced 2024-11-22 07:58:05 +01:00
added one more case
This commit is contained in:
parent
89a1841d57
commit
387c533fad
1 changed files with 6 additions and 0 deletions
6
testdata/src/example.go
vendored
6
testdata/src/example.go
vendored
|
@ -65,6 +65,12 @@ func example() {
|
||||||
ctx = wrapContext(ctx) // want "nested context in function literal"
|
ctx = wrapContext(ctx) // want "nested context in function literal"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// this is fine because the context is created in the loop
|
||||||
|
for {
|
||||||
|
if ctx := context.Background(); doSomething() != nil {
|
||||||
|
ctx = wrapContext(ctx)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func wrapContext(ctx context.Context) context.Context {
|
func wrapContext(ctx context.Context) context.Context {
|
||||||
|
|
Loading…
Reference in a new issue