rename bytes.Buffer.Data() to bytes.Buffer.Bytes()

R=rsc
DELTA=152  (6 added, 0 deleted, 146 changed)
OCL=34695
CL=34701
This commit is contained in:
Rob Pike 2009-09-16 15:15:00 -07:00
parent 2a1c9377d9
commit d5be41fc4e
30 changed files with 111 additions and 105 deletions

View file

@ -25,16 +25,16 @@ func init() {
// Verify that contents of buf match the string s.
func check(t *testing.T, testname string, buf *Buffer, s string) {
if buf.Len() != len(buf.Data()) {
t.Errorf("%s: buf.Len() == %d, len(buf.Data()) == %d\n", testname, buf.Len(), len(buf.Data()))
if buf.Len() != len(buf.Bytes()) {
t.Errorf("%s: buf.Len() == %d, len(buf.Bytes()) == %d\n", testname, buf.Len(), len(buf.Bytes()))
}
if buf.Len() != len(s) {
t.Errorf("%s: buf.Len() == %d, len(s) == %d\n", testname, buf.Len(), len(s))
}
if string(buf.Data()) != s {
t.Errorf("%s: string(buf.Data()) == %q, s == %q\n", testname, string(buf.Data()), s)
if string(buf.Bytes()) != s {
t.Errorf("%s: string(buf.Bytes()) == %q, s == %q\n", testname, string(buf.Bytes()), s)
}
}