mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-19 23:16:48 +00:00
Bump golangci-lint to v1.24.0, linter fixes and general code improvements (#478)
* Bump golangci-lint version, update Go version deps and generic code improvements * Fix wesbocket resp nil check and zip closures * Update pprof path
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
@@ -64,20 +63,10 @@ func (vm *VM) Load(file string) error {
|
||||
log.Debugf(log.GCTScriptMgr, "Loading script: %s ID: %v", vm.ShortName(), vm.ID)
|
||||
}
|
||||
|
||||
f, err := os.Open(file)
|
||||
code, err := ioutil.ReadFile(file)
|
||||
if err != nil {
|
||||
return &Error{
|
||||
Action: "Load: Open",
|
||||
Script: file,
|
||||
Cause: err,
|
||||
}
|
||||
}
|
||||
|
||||
defer f.Close()
|
||||
code, err := ioutil.ReadAll(f)
|
||||
if err != nil {
|
||||
return &Error{
|
||||
Action: "Load: Read",
|
||||
Action: "Load: ReadFile",
|
||||
Script: file,
|
||||
Cause: err,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user