mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
CI: Fix golangci-lint linter issues, add prealloc linter and bump version depends for Go 1.18 (#915)
* Bump CI versions * Specifically set go version as 1.17.x bumps it to 1.18 * Another * Adjust AppVeyor * Part 1 of linter issues * Part 2 * Fix various linters and improvements * Part 3 * Finishing touches * Tests and EqualFold * Fix nitterinos plus bonus requester jobs bump for exchanges with large number of tests * Fix nitterinos and bump golangci-lint timeout for AppVeyor * Address nits, ensure all books are returned on err due to syncer regression * Fix the wiggins * Fix duplication * Fix nitterinos
This commit is contained in:
@@ -285,11 +285,11 @@ func (d *Dispatcher) subscribe(id uuid.UUID) (chan interface{}, error) {
|
||||
|
||||
// Read lock to read route list
|
||||
d.rMtx.RLock()
|
||||
_, ok := d.routes[id]
|
||||
d.rMtx.RUnlock()
|
||||
if !ok {
|
||||
if _, ok := d.routes[id]; !ok {
|
||||
d.rMtx.RUnlock()
|
||||
return nil, errors.New("dispatcher uuid not found in route list")
|
||||
}
|
||||
d.rMtx.RUnlock()
|
||||
|
||||
// Get an unused channel from the channel pool
|
||||
unusedChan, ok := d.outbound.Get().(chan interface{})
|
||||
@@ -314,11 +314,11 @@ func (d *Dispatcher) unsubscribe(id uuid.UUID, usedChan chan interface{}) error
|
||||
|
||||
// Read lock to read route list
|
||||
d.rMtx.RLock()
|
||||
_, ok := d.routes[id]
|
||||
d.rMtx.RUnlock()
|
||||
if !ok {
|
||||
if _, ok := d.routes[id]; !ok {
|
||||
d.rMtx.RUnlock()
|
||||
return errors.New("dispatcher uuid does not reference any channels")
|
||||
}
|
||||
d.rMtx.RUnlock()
|
||||
|
||||
// Lock for write to delete references
|
||||
d.rMtx.Lock()
|
||||
|
||||
@@ -71,7 +71,6 @@ type job struct {
|
||||
type Mux struct {
|
||||
// Reference to the main running dispatch service
|
||||
d *Dispatcher
|
||||
sync.RWMutex
|
||||
}
|
||||
|
||||
// Pipe defines an outbound object to the desired routine
|
||||
|
||||
Reference in New Issue
Block a user