mirror of
https://github.com/Crocmagnon/fatcontext.git
synced 2024-11-24 00:48:06 +01:00
Fix array test
The prior construct probably shouldn't issue an error. These, however, both should (and do).
This commit is contained in:
parent
3e9e29f41c
commit
0e13d068ad
1 changed files with 9 additions and 3 deletions
12
testdata/src/example.go
vendored
12
testdata/src/example.go
vendored
|
@ -59,9 +59,15 @@ func inStructs(ctx context.Context) {
|
||||||
c.Ctx = context.WithValue(c.Ctx, "other", "val")
|
c.Ctx = context.WithValue(c.Ctx, "other", "val")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r := []struct{ Ctx context.Context }{{ctx}}
|
||||||
for i := 0; i < 10; i++ {
|
for i := 0; i < 10; i++ {
|
||||||
c := []*struct{ Ctx context.Context }{{ctx}}
|
r[0].Ctx = context.WithValue(r[0].Ctx, "key", i) // want "nested context in loop"
|
||||||
c[0].Ctx = context.WithValue(c[0].Ctx, "key", i) // want "nested context in loop"
|
r[0].Ctx = context.WithValue(r[0].Ctx, "other", "val")
|
||||||
c[0].Ctx = context.WithValue(c[0].Ctx, "other", "val")
|
}
|
||||||
|
|
||||||
|
rp := []*struct{ Ctx context.Context }{{ctx}}
|
||||||
|
for i := 0; i < 10; i++ {
|
||||||
|
rp[0].Ctx = context.WithValue(rp[0].Ctx, "key", i) // want "nested context in loop"
|
||||||
|
rp[0].Ctx = context.WithValue(rp[0].Ctx, "other", "val")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue