1
0
mirror of https://github.com/golang/go synced 2024-10-02 12:18:33 -06:00

os: simplify WriteString

It was working too hard.

R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/4639081
This commit is contained in:
Rob Pike 2011-06-28 11:09:21 +10:00
parent 46e7466080
commit f71153278a

View File

@ -187,9 +187,7 @@ func (file *File) WriteString(s string) (ret int, err Error) {
if file == nil { if file == nil {
return 0, EINVAL return 0, EINVAL
} }
b := syscall.StringByteSlice(s) return file.Write([]byte(s))
b = b[0 : len(b)-1]
return file.Write(b)
} }
// Mkdir creates a new directory with the specified name and permission bits. // Mkdir creates a new directory with the specified name and permission bits.