gofmt-ify syscall

(replacement for CL 1018053)

R=r
http://go/go-review/1017047
This commit is contained in:
Robert Griesemer 2009-11-05 10:55:57 -08:00
parent 30c7088c95
commit bd4f94057f
16 changed files with 168 additions and 178 deletions

View file

@ -5,25 +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);
return "-"+str(-val);
}
var buf [32]byte; // big enough for int64
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 + '0');
buf[i] = byte(val+'0');
return string(buf[i:len(buf)]);
}
func Errstr(errno int) string {
if errno < 0 || errno >= int(len(errors)) {
return "error " + str(errno)
return "error "+str(errno);
}
return errors[errno]
return errors[errno];
}