package os
import (
- "error"
+ "errors"
"syscall"
)
if err == nil {
return nil
}
- return &SyscallError{syscall, err.String()}
+ return &SyscallError{syscall, err.Error()}
}
var (
package os
import (
+ "errors"
"runtime"
"syscall"
)
func (p *Process) Signal(sig Signal) error {
if p.done {
- return NewError("os: process already finished")
+ return errors.New("os: process already finished")
}
f, e := OpenFile("/proc/"+itoa(p.Pid)+"/note", O_WRONLY, 0)
// An Error can represent any printable error condition.
type Error interface {
- String() string
+ error
}
// ErrorString implements Error's String method by returning itself.
type ErrorString string
-func (e ErrorString) String() string { return string(e) }
+func (e ErrorString) Error() string { return string(e) }
// NewError converts s to an ErrorString, which satisfies the Error interface.
func NewError(s string) Error { return ErrorString(s) }