diff --git a/go.sum b/go.sum index c2fa67ae4..0904cb645 100644 --- a/go.sum +++ b/go.sum @@ -117,6 +117,7 @@ github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPx github.com/sirupsen/logrus v1.4.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/skycoin/dmsg v0.0.0-20190805065636-70f4c32a994f/go.mod h1:obZYZp8eKR7Xqz+KNhJdUE6Gvp6rEXbDO8YTlW2YXgU= github.com/skycoin/skycoin v0.26.0 h1:xDxe2r8AclMntZ550Y/vUQgwgLtwrf9Wu5UYiYcN5/o= github.com/skycoin/skycoin v0.26.0/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= diff --git a/pkg/app2/idmanager/manager.go b/pkg/app2/idmanager/manager.go index 2d84faf4e..32b41bb56 100644 --- a/pkg/app2/idmanager/manager.go +++ b/pkg/app2/idmanager/manager.go @@ -23,14 +23,14 @@ type Manager struct { lstID uint16 } -// NewIDManager constructs new `Manager`. +// New constructs new `Manager`. func New() *Manager { return &Manager{ values: make(map[uint16]interface{}), } } -// `ReserveNextID` reserves next free slot for the value and returns the id for it. +// ReserveNextID reserves next free slot for the value and returns the id for it. func (m *Manager) ReserveNextID() (id *uint16, free func() bool, err error) { m.mx.Lock() @@ -53,7 +53,7 @@ func (m *Manager) ReserveNextID() (id *uint16, free func() bool, err error) { return &nxtID, m.constructFreeFunc(nxtID), nil } -// pop removes value specified by `id` from the idManager instance and +// Pop removes value specified by `id` from the idManager instance and // returns it. func (m *Manager) Pop(id uint16) (interface{}, error) { m.mx.Lock() @@ -74,7 +74,7 @@ func (m *Manager) Pop(id uint16) (interface{}, error) { return v, nil } -// add adds the new value `v` associated with `id`. +// Add adds the new value `v` associated with `id`. func (m *Manager) Add(id uint16, v interface{}) (free func() bool, err error) { m.mx.Lock() @@ -89,7 +89,7 @@ func (m *Manager) Add(id uint16, v interface{}) (free func() bool, err error) { return m.constructFreeFunc(id), nil } -// set sets value `v` associated with `id`. +// Set sets value `v` associated with `id`. func (m *Manager) Set(id uint16, v interface{}) error { m.mx.Lock() @@ -109,7 +109,7 @@ func (m *Manager) Set(id uint16, v interface{}) error { return nil } -// get gets the value associated with the `id`. +// Get gets the value associated with the `id`. func (m *Manager) Get(id uint16) (interface{}, bool) { m.mx.RLock() lis, ok := m.values[id] @@ -120,7 +120,7 @@ func (m *Manager) Get(id uint16) (interface{}, bool) { return lis, ok } -// doRange performs range over the manager contents. Loop stops when +// DoRange performs range over the manager contents. Loop stops when // `next` returns false. func (m *Manager) DoRange(next func(id uint16, v interface{}) bool) { m.mx.RLock()