diff --git a/posting/list.go b/posting/list.go index cef683f13c7acc948d81354b98e8c7b5f795fa89..73aa2d2f250fdeea0267d16176e6bbf7266abc82 100644 --- a/posting/list.go +++ b/posting/list.go @@ -105,8 +105,7 @@ func samePosting(a *types.Posting, b *types.Posting) bool { // key = (entity uid, attribute) func Key(uid uint64, attr string) []byte { - buf := new(bytes.Buffer) - buf.WriteString(attr) + buf := bytes.NewBufferString(attr) if err := binary.Write(buf, binary.LittleEndian, uid); err != nil { glog.Fatalf("Error while creating key with attr: %v uid: %v\n", attr, uid) }