Add project documentation and licensing
[go-signalcontext.git] / error.go
index c0a4f97..3ca599e 100644 (file)
--- a/error.go
+++ b/error.go
@@ -1,12 +1,12 @@
 package signalcontext
 
 import (
-       "fmt"
        "os"
 )
 
 // A Error will be returned by a SignalContext’s Err() method when it
-// was finished due to a signal (rather than e.g. parent cancellation).
+// canceled due to an operating system signal (rather than e.g. parent
+// cancellation).
 type Error struct {
        os.Signal
 }
@@ -16,5 +16,5 @@ func (e Error) Error() string {
 }
 
 func (e Error) String() string {
-       return fmt.Sprintf("received signal: %s", e.Signal)
+       return "received signal: " + e.Signal.String()
 }