mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-06-06 15:10:59 +00:00
golangci-lint/CI: Bump versions and introduce new linters (#798)
* golangci-lint/CI: Bump versions
Fix remaining linter issues
* Specifically set AppVeyor version
* Fix the infamous typos 👀
* Add go env cmd to AppVeyor
* Add go version cmd to AppVeyor
* Specify AppVeyor image, adjust linters
* Update go get to go install due to deprecation
* Bump golangci-lint timeout time for AppVeyor
* Change NW contract to NQ
* Address nitters
* GetRandomPair -> Pair{}
* Address nits
* Address time nitterinos plus additional tweaks
* More time inception upgrades!
* Bending time and space
This commit is contained in:
@@ -8,8 +8,7 @@ import (
|
||||
|
||||
func TestNewComm(t *testing.T) {
|
||||
var cfg base.CommunicationsConfig
|
||||
_, err := NewComm(&cfg)
|
||||
if err == nil {
|
||||
if _, err := NewComm(&cfg); err == nil {
|
||||
t.Error("NewComm should have failed on no enabled communication mediums")
|
||||
}
|
||||
|
||||
|
||||
@@ -67,8 +67,7 @@ func (s *Slack) Setup(cfg *base.CommunicationsConfig) {
|
||||
|
||||
// Connect connects to the service
|
||||
func (s *Slack) Connect() error {
|
||||
err := s.NewConnection()
|
||||
if err != nil {
|
||||
if err := s.NewConnection(); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -25,8 +25,7 @@ func TestSetup(t *testing.T) {
|
||||
func TestConnect(t *testing.T) {
|
||||
t.Parallel()
|
||||
var s Slack
|
||||
err := s.Connect()
|
||||
if err == nil {
|
||||
if err := s.Connect(); err == nil {
|
||||
t.Error("slack Connect() error cannot be nil")
|
||||
}
|
||||
}
|
||||
@@ -43,8 +42,7 @@ func TestPushEvent(t *testing.T) {
|
||||
func TestBuildURL(t *testing.T) {
|
||||
t.Parallel()
|
||||
var s Slack
|
||||
v := s.BuildURL("lol123")
|
||||
if v != "https://slack.com/api/rtm.start?token=lol123" {
|
||||
if v := s.BuildURL("lol123"); v != "https://slack.com/api/rtm.start?token=lol123" {
|
||||
t.Error("slack BuildURL() error")
|
||||
}
|
||||
}
|
||||
@@ -183,8 +181,7 @@ func TestGetUsersInGroup(t *testing.T) {
|
||||
func TestNewConnection(t *testing.T) {
|
||||
t.Parallel()
|
||||
var s Slack
|
||||
err := s.NewConnection()
|
||||
if err == nil {
|
||||
if err := s.NewConnection(); err == nil {
|
||||
t.Error("slack NewConnection() error")
|
||||
}
|
||||
}
|
||||
@@ -192,8 +189,7 @@ func TestNewConnection(t *testing.T) {
|
||||
func TestWebsocketConnect(t *testing.T) {
|
||||
t.Parallel()
|
||||
var s Slack
|
||||
err := s.WebsocketConnect()
|
||||
if err == nil {
|
||||
if err := s.WebsocketConnect(); err == nil {
|
||||
t.Error("slack WebsocketConnect() error")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,9 +18,8 @@ func TestSetup(t *testing.T) {
|
||||
func TestConnect(t *testing.T) {
|
||||
t.Parallel()
|
||||
var s SMSGlobal
|
||||
err := s.Connect()
|
||||
if err != nil {
|
||||
t.Error("SMSGlobal Connect() error", err)
|
||||
if err := s.Connect(); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,9 +42,8 @@ func TestGetEnabledContacts(t *testing.T) {
|
||||
},
|
||||
},
|
||||
}
|
||||
v := s.GetEnabledContacts()
|
||||
if v != 1 {
|
||||
t.Error("SMSGlobal GetEnabledContacts() error")
|
||||
if v := s.GetEnabledContacts(); v != 1 {
|
||||
t.Error("expected one enabled contact")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,7 @@ func TestSetup(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestConnect(t *testing.T) {
|
||||
err := s.Connect()
|
||||
if err != nil {
|
||||
if err := s.Connect(); err != nil {
|
||||
t.Error("smtpservice Connect() error", err)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,8 @@ func TestSetup(t *testing.T) {
|
||||
func TestConnect(t *testing.T) {
|
||||
t.Parallel()
|
||||
var T Telegram
|
||||
err := T.Connect()
|
||||
if err == nil {
|
||||
t.Error("telegram Connect() error")
|
||||
if err := T.Connect(); err == nil {
|
||||
t.Error("expected error")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -91,8 +90,7 @@ func TestHandleMessages(t *testing.T) {
|
||||
func TestGetUpdates(t *testing.T) {
|
||||
t.Parallel()
|
||||
var T Telegram
|
||||
_, err := T.GetUpdates()
|
||||
if err != nil {
|
||||
if _, err := T.GetUpdates(); err != nil {
|
||||
t.Error("telegram GetUpdates() error", err)
|
||||
}
|
||||
}
|
||||
@@ -100,10 +98,8 @@ func TestGetUpdates(t *testing.T) {
|
||||
func TestTestConnection(t *testing.T) {
|
||||
t.Parallel()
|
||||
var T Telegram
|
||||
err := T.TestConnection()
|
||||
if err.Error() != testErrNotFound {
|
||||
t.Errorf("telegram TestConnection() error, expected 'Not found' got '%s'",
|
||||
err)
|
||||
if err := T.TestConnection(); err.Error() != testErrNotFound {
|
||||
t.Errorf("received %s, expected: %s", err, testErrNotFound)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user