Linter fixes (#246)

Linter fixes
This commit is contained in:
Adrian Gallagher
2019-02-05 16:26:04 +11:00
committed by GitHub
parent d7368c1a8d
commit 5e5ca8a887
85 changed files with 641 additions and 794 deletions

View File

@@ -96,7 +96,7 @@ func TestGetChannelsString(t *testing.T) {
testpassed = true
}
}
if testpassed == false {
if !testpassed {
t.Error("test failed - slack GetChannelsString() error")
}
}

View File

@@ -4,6 +4,7 @@ package smsglobal
import (
"errors"
"flag"
"net/http"
"net/url"
"strings"
@@ -164,7 +165,7 @@ func (s *SMSGlobal) SendMessage(to, message string) error {
headers := make(map[string]string)
headers["Content-Type"] = "application/x-www-form-urlencoded"
resp, err := common.SendHTTPRequest("POST",
resp, err := common.SendHTTPRequest(http.MethodPost,
smsGlobalAPIURL,
headers,
strings.NewReader(values.Encode()))

View File

@@ -7,6 +7,7 @@ import (
"bytes"
"errors"
"fmt"
"net/http"
"github.com/thrasher-/gocryptotrader/common"
"github.com/thrasher-/gocryptotrader/communications/base"
@@ -221,7 +222,7 @@ func (t *Telegram) SendHTTPRequest(path string, json []byte, result interface{})
headers := make(map[string]string)
headers["content-type"] = "application/json"
resp, err := common.SendHTTPRequest("POST", path, headers, bytes.NewBuffer(json))
resp, err := common.SendHTTPRequest(http.MethodPost, path, headers, bytes.NewBuffer(json))
if err != nil {
return err
}

View File

@@ -13,8 +13,8 @@ func TestSetup(t *testing.T) {
cfg := config.GetConfig()
cfg.LoadConfig("../../testdata/configtest.json")
T.Setup(cfg.GetCommunicationsConfig())
if T.Name != "Telegram" || T.Enabled != false ||
T.Token != "testest" || T.Verbose != false {
if T.Name != "Telegram" || T.Enabled ||
T.Token != "testest" || T.Verbose {
t.Error("test failed - telegram Setup() error, unexpected setup values",
T.Name, T.Enabled, T.Token, T.Verbose)
}