Skip to content

Commit 3875fac

Browse files
author
rht
committed
Replace 'var * bytes.Buffer' with '\1 := new(bytes.Buffer)'
1 parent 58070ee commit 3875fac

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

cli/parse.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ func appendString(args, inputs []string) ([]string, []string) {
321321
}
322322

323323
func appendStdinAsString(args []string, stdin *os.File) ([]string, *os.File, error) {
324-
var buf bytes.Buffer
324+
buf := new(bytes.Buffer)
325325

326326
_, err := buf.ReadFrom(stdin)
327327
if err != nil {

response_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func TestMarshalling(t *testing.T) {
3232
if err != nil {
3333
t.Error(err, "Should have passed")
3434
}
35-
var buf bytes.Buffer
35+
buf := new(bytes.Buffer)
3636
buf.ReadFrom(reader)
3737
output := buf.String()
3838
if removeWhitespace(output) != "{\"Foo\":\"beep\",\"Bar\":\"boop\",\"Baz\":1337}" {

0 commit comments

Comments
 (0)