From 7989a080afa7d14c32f27fc087f0a65a7d620db2 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Mon, 1 Oct 2018 17:10:03 -0700 Subject: [PATCH] don't put the buffer struct on the heap This showed up when profile go-ipfs. --- codec.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec.go b/codec.go index 9c0c5bc..fe672ac 100644 --- a/codec.go +++ b/codec.go @@ -11,7 +11,7 @@ func stringToBytes(s string) ([]byte, error) { // consume trailing slashes s = strings.TrimRight(s, "/") - b := new(bytes.Buffer) + var b bytes.Buffer sp := strings.Split(s, "/") if sp[0] != "" {