mirror of
https://github.com/golang/go
synced 2024-11-19 14:54:43 -07: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:
parent
46e7466080
commit
f71153278a
@ -187,9 +187,7 @@ func (file *File) WriteString(s string) (ret int, err Error) {
|
||||
if file == nil {
|
||||
return 0, EINVAL
|
||||
}
|
||||
b := syscall.StringByteSlice(s)
|
||||
b = b[0 : len(b)-1]
|
||||
return file.Write(b)
|
||||
return file.Write([]byte(s))
|
||||
}
|
||||
|
||||
// Mkdir creates a new directory with the specified name and permission bits.
|
||||
|
Loading…
Reference in New Issue
Block a user