Accept some linter suggestions

This commit is contained in:
Ryan Westlund 2020-05-14 19:49:59 -04:00
parent 55f8c7c042
commit 57cad7eabc
12 changed files with 42 additions and 60 deletions

View file

@ -54,12 +54,11 @@ func (c *cancellation) Cancel(err error) error {
defer c.mutex.Unlock()
if c.done {
return c.err
} else {
c.err = err
c.done = true
close(c.cancel)
return nil
}
c.err = err
c.done = true
close(c.cancel)
return nil
}
// Error returns the error provided to Cancel, or nil if no error has been provided.