diff options
Diffstat (limited to 'src/pkg/syscall/errstr.go')
-rw-r--r-- | src/pkg/syscall/errstr.go | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/pkg/syscall/errstr.go b/src/pkg/syscall/errstr.go index 87c354d05..94a799a80 100644 --- a/src/pkg/syscall/errstr.go +++ b/src/pkg/syscall/errstr.go @@ -5,24 +5,24 @@ package syscall -func str(val int) string { // do it here rather than with fmt to avoid dependency +func str(val int) string { // do it here rather than with fmt to avoid dependency if val < 0 { return "-" + str(-val) } - var buf [32]byte; // big enough for int64 - i := len(buf) - 1; + var buf [32]byte // big enough for int64 + i := len(buf) - 1 for val >= 10 { - buf[i] = byte(val%10 + '0'); - i--; - val /= 10; + buf[i] = byte(val%10 + '0') + i-- + val /= 10 } - buf[i] = byte(val + '0'); - return string(buf[i:]); + buf[i] = byte(val + '0') + return string(buf[i:]) } func Errstr(errno int) string { if errno < 0 || errno >= int(len(errors)) { return "error " + str(errno) } - return errors[errno]; + return errors[errno] } |