From c24e10646fe3981353abdff342f46ebcb48d5231 Mon Sep 17 00:00:00 2001 From: Dan Willhite Date: Fri, 25 Aug 2017 17:20:04 -0700 Subject: [PATCH] Change msg key to be date-based rather than consecutive integer --- samples/go/ipfs-chat/model.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/go/ipfs-chat/model.go b/samples/go/ipfs-chat/model.go index c0fb8f9675..c7f422f194 100644 --- a/samples/go/ipfs-chat/model.go +++ b/samples/go/ipfs-chat/model.go @@ -38,7 +38,7 @@ type Message struct { } func (m Message) ID() string { - return fmt.Sprintf("%016x/%s", m.Ordinal, m.Author) + return fmt.Sprintf("%020x/%s", m.ClientTime.UnixNano(), m.Author) } func AddMessage(body string, author string, clientTime time.Time, ds datas.Dataset) (datas.Dataset, error) {