mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Merge branch 'master' into engine
This commit is contained in:
@@ -8,33 +8,9 @@ tenets:
|
||||
- import: codelingo/effective-go/unnecessary-else
|
||||
- import: codelingo/code-review-comments/declare-empty-slice
|
||||
- import: codelingo/effective-go/defer-close-file
|
||||
# Overwrite one tenet with custom logic
|
||||
# - import: codelingo/effective-go/comment-first-word-when-empty
|
||||
- name: comment-first-word-when-empty
|
||||
flows:
|
||||
codelingo/review:
|
||||
comment: |
|
||||
Every exported function in a program should have a doc comment. The first sentence should be a summary that starts with the name ({{funcName}}) being declared.
|
||||
From [effective go](https://golang.org/doc/effective_go.html#commentary).
|
||||
codelingo/rewrite:
|
||||
place: holder
|
||||
query: |
|
||||
import codelingo/ast/go
|
||||
@review comment
|
||||
@rewrite --prepend --line "// {{funcName}} is a function."
|
||||
go.func_decl(depth = any):
|
||||
# Customisation to exclude test packages
|
||||
exclude:
|
||||
go.ident:
|
||||
name as funcname
|
||||
regex(/_test/, funcname)
|
||||
exclude:
|
||||
go.comment_group
|
||||
go.ident:
|
||||
name as funcName
|
||||
public == "true"
|
||||
- import: codelingo/effective-go/comment-first-word-when-empty
|
||||
- name: missing-stop-ticker
|
||||
flows:
|
||||
actions:
|
||||
codelingo/review:
|
||||
comment: Add `defer {{varName}}.Stop()` to stop the ticker and release associated resources.
|
||||
query: |
|
||||
|
||||
@@ -292,10 +292,6 @@ func (e *Engine) Start() {
|
||||
|
||||
log.Debugln(log.Global, "Setting up exchanges..")
|
||||
SetupExchanges()
|
||||
if len(e.Exchanges) == 0 {
|
||||
log.Errorln(log.Global, "No exchanges were able to be loaded. Exiting")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if e.Settings.EnableCommsRelayer {
|
||||
if err := e.CommsManager.Start(); err != nil {
|
||||
|
||||
@@ -2,6 +2,7 @@ package engine
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
|
||||
@@ -309,4 +310,8 @@ func SetupExchanges() {
|
||||
)
|
||||
}
|
||||
wg.Wait()
|
||||
if len(Bot.Exchanges) == 0 {
|
||||
log.Errorln(log.Global, "No exchanges were able to be loaded. Exiting")
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user