From 4fe9f93940dd8a3e1d7dab2c0eb46d1cb9bace1c Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Wed, 7 Mar 2018 14:38:18 +0200 Subject: [PATCH] Re-order atomic field to please race detector --- cluster.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cluster.go b/cluster.go index 89f1e9a4..767df5f1 100644 --- a/cluster.go +++ b/cluster.go @@ -491,13 +491,14 @@ func (c *clusterState) slotNodes(slot int) []*clusterNode { //------------------------------------------------------------------------------ type clusterStateHolder struct { - load func() (*clusterState, error) - reloading uint32 // atomic + load func() (*clusterState, error) state atomic.Value lastErrMu sync.RWMutex lastErr error + + reloading uint32 // atomic } func newClusterStateHolder(fn func() (*clusterState, error)) *clusterStateHolder {