From ccc4e0ab658448c2c2bcfe61b4cac3d35645a027 Mon Sep 17 00:00:00 2001 From: ReneWerner87 Date: Sun, 22 Aug 2021 10:13:44 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20panic:=20unaligned=2064-bit=20at?= =?UTF-8?q?omic=20operation=20[32=20bit=20machines]=20#1487=20https://pkg.?= =?UTF-8?q?go.dev/sync/atomic#pkg-notes=20https://go101.org/article/memory?= =?UTF-8?q?-layout.html=20https://github.com/golang/go/issues/36606?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/memory/memory.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/memory/memory.go b/internal/memory/memory.go index b438baa8ae..cba16cc415 100644 --- a/internal/memory/memory.go +++ b/internal/memory/memory.go @@ -13,8 +13,8 @@ type Storage struct { } type item struct { - v interface{} // val e uint64 // exp + v interface{} // val } func New() *Storage { @@ -45,7 +45,7 @@ func (s *Storage) Set(key string, val interface{}, ttl time.Duration) { exp = uint64(ttl.Seconds()) + atomic.LoadUint64(&s.ts) } s.Lock() - s.data[key] = item{val, exp} + s.data[key] = item{exp, val} s.Unlock() }