gosimple: select with single case
select with single case
can be simplified to a plain receive.
@@ -141,10 +141,8 @@ func (ctx *Context) Close() error {
func (ctx *Context) WithCancelChannel(c <-chan struct{}) *Context {
copy := *ctx
go func() {
- select {
- case _, _ = <-c:
+ <-c
copy.Close()
- }
}()
return &copy
}
