mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-02 23:16:51 +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:
@@ -1,6 +1,7 @@
|
||||
package vm
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
|
||||
"github.com/gofrs/uuid"
|
||||
@@ -50,17 +51,21 @@ func (g *GctScriptManager) ShutdownAll() (err error) {
|
||||
log.Debugln(log.GCTScriptMgr, "Shutting down all Virtual Machines")
|
||||
}
|
||||
|
||||
var errors []error
|
||||
var shutdownErrors []error
|
||||
AllVMSync.Range(func(k, v interface{}) bool {
|
||||
errShutdown := v.(*VM).Shutdown()
|
||||
vm, ok := v.(*VM)
|
||||
if !ok {
|
||||
shutdownErrors = append(shutdownErrors, errors.New("unable to type assert VM"))
|
||||
}
|
||||
errShutdown := vm.Shutdown()
|
||||
if err != nil {
|
||||
errors = append(errors, errShutdown)
|
||||
shutdownErrors = append(shutdownErrors, errShutdown)
|
||||
}
|
||||
return true
|
||||
})
|
||||
|
||||
if len(errors) > 0 {
|
||||
err = fmt.Errorf("failed to shutdown the following Virtual Machines: %v", errors)
|
||||
if len(shutdownErrors) > 0 {
|
||||
err = fmt.Errorf("failed to shutdown the following Virtual Machines: %v", shutdownErrors)
|
||||
}
|
||||
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user