fix map passed by reference in shallow struct copy

This commit is contained in:
Andrew Martinez
2021-03-08 15:58:57 -05:00
parent fff256487c
commit 219c19c8e7
+9 -1
View File
@@ -140,7 +140,15 @@ func (r *LockingRouterState) Values() RouterStateValues {
r.lock.Lock()
defer r.lock.Unlock()
return r.internal
ret := r.internal
ret.Protocols = map[string]string{}
for k, v := range r.internal.Protocols {
ret.Protocols[k] = v
}
return ret
}
func (r *LockingRouterState) SetIsOnline(isOnline bool) {