Home | History | Annotate | Download | only in testdata

Lines Matching refs:cancel

17 	var ctx, cancel = context.WithCancel() // ERROR "the cancel function is not used on all paths \(possible context leak\)"
18 } // ERROR "this return statement may be reached without using the cancel var defined on line 17"
31 ctx, _ := context.WithCancel() // ERROR "the cancel function returned by context.WithCancel should be called, not discarded, to avoid a context leak"
32 ctx, _ = context.WithTimeout() // ERROR "the cancel function returned by context.WithTimeout should be called, not discarded, to avoid a context leak"
33 ctx, _ = context.WithDeadline() // ERROR "the cancel function returned by context.WithDeadline should be called, not discarded, to avoid a context leak"
37 ctx, cancel := context.WithCancel()
38 defer cancel() // ok
42 ctx, cancel := context.WithCancel() // ERROR "not used on all paths"
44 cancel()
46 return // ERROR "this return statement may be reached without using the cancel var"
50 ctx, cancel := context.WithCancel()
52 cancel()
62 ctx, cancel := context.WithCancel() // ERROR "not used on all paths"
64 cancel()
70 } // ERROR "this return statement may be reached without using the cancel var"
73 ctx, cancel := context.WithCancel()
81 cancel()
91 ctx, cancel := context.WithCancel() // ERROR "not used on all paths"
98 cancel()
104 } // ERROR "this return statement may be reached without using the cancel var"
107 ctx, cancel := context.WithCancel() // ERROR "not used on all paths"
114 cancel()
118 } // ERROR "this return statement may be reached without using the cancel var"
121 ctx, cancel := context.WithCancel()
131 ctx, cancel := context.WithCancel() // ERROR "not used on all paths"
133 }() // ERROR "may be reached without using the cancel var"
146 func _() (ctx context.Context, cancel func()) {
147 ctx, cancel = context.WithCancel()
152 var _ = func() (ctx context.Context, cancel func()) {
153 ctx, cancel = context.WithCancel()