mirror of https://github.com/go-python/gopy.git
Merge pull request #335 from testwill/string
chore: use xxx.String() instead of string(xxx.Bytes())
This commit is contained in:
commit
a5b96e6096
|
@ -49,7 +49,7 @@ impl 1
|
|||
impl 2
|
||||
`
|
||||
|
||||
str := string(out.Bytes())
|
||||
str := out.String()
|
||||
if !reflect.DeepEqual(str, want) {
|
||||
t.Fatalf("error:\nwant=%q\ngot =%q\n", want, str)
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ func TestGovet(t *testing.T) {
|
|||
cmd.Stderr = buf
|
||||
err := cmd.Run()
|
||||
if err != nil {
|
||||
t.Fatalf("error running %s:\n%s\n%v", "go vet", string(buf.Bytes()), err)
|
||||
t.Fatalf("error running %s:\n%s\n%v", "go vet", buf.String(), err)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,11 +91,11 @@ func TestGofmt(t *testing.T) {
|
|||
|
||||
err = cmd.Run()
|
||||
if err != nil {
|
||||
t.Fatalf("error running %s:\n%s\n%v", exe, string(buf.Bytes()), err)
|
||||
t.Fatalf("error running %s:\n%s\n%v", exe, buf.String(), err)
|
||||
}
|
||||
|
||||
if len(buf.Bytes()) != 0 {
|
||||
t.Errorf("some files were not gofmt'ed:\n%s\n", string(buf.Bytes()))
|
||||
t.Errorf("some files were not gofmt'ed:\n%s\n", buf.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue