From 2de61b2d9a35293fd392d6b243a7f3d5844be02d Mon Sep 17 00:00:00 2001 From: Dave Collins Date: Wed, 17 Aug 2016 12:39:34 -0500 Subject: [PATCH] Manually copy relevant fields in ntfn state copy. (#84) This makes vet happy by manually copying the notification state fields during the deep copy instead of copying the entire struct which contains an embedded mutex. --- notify.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/notify.go b/notify.go index 908ec9d1..45c0b893 100644 --- a/notify.go +++ b/notify.go @@ -47,7 +47,10 @@ func (s *notificationState) Copy() *notificationState { s.Lock() defer s.Unlock() - stateCopy := *s + var stateCopy notificationState + stateCopy.notifyBlocks = s.notifyBlocks + stateCopy.notifyNewTx = s.notifyNewTx + stateCopy.notifyNewTxVerbose = s.notifyNewTxVerbose stateCopy.notifyReceived = make(map[string]struct{}) for addr := range s.notifyReceived { stateCopy.notifyReceived[addr] = struct{}{}