Reuse the same channel for all precompleted contexts
[go-signalcontext.git] / error.go
1 package signalcontext
2
3 import (
4 "os"
5 )
6
7 // A Error will be returned by a SignalContext’s Err() method when it
8 // was finished due to a signal (rather than e.g. parent cancellation).
9 type Error struct {
10 os.Signal
11 }
12
13 func (e Error) Error() string {
14 return e.String()
15 }
16
17 func (e Error) String() string {
18 return "received signal: " + e.Signal.String()
19 }