don't put the buffer struct on the heap

This showed up when profile go-ipfs.
This commit is contained in:
Steven Allen 2018-10-01 17:10:03 -07:00
parent 2e9c819c18
commit 7989a080af

View File

@ -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] != "" {