Add project documentation and licensing
[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 // canceled due to an operating system signal (rather than e.g. parent
9 // cancellation).
10 type Error struct {
11 os.Signal
12 }
13
14 func (e Error) Error() string {
15 return e.String()
16 }
17
18 func (e Error) String() string {
19 return "received signal: " + e.Signal.String()
20 }