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:
Adrian Gallagher
2021-10-14 16:38:53 +11:00
committed by GitHub
parent 0a91af0f2e
commit f0d45aa1d2
194 changed files with 1506 additions and 1233 deletions

View File

@@ -19,8 +19,7 @@ type fakeDataHandler struct {
func TestBaseDataFunctions(t *testing.T) {
t.Parallel()
var d Base
latest := d.Latest()
if latest != nil {
if latest := d.Latest(); latest != nil {
t.Error("expected nil")
}
d.Next()
@@ -37,17 +36,14 @@ func TestBaseDataFunctions(t *testing.T) {
if o != 0 {
t.Error("expected 0")
}
list := d.List()
if list != nil {
if list := d.List(); list != nil {
t.Error("expected nil")
}
history := d.History()
if history != nil {
if history := d.History(); history != nil {
t.Error("expected nil")
}
d.SetStream(nil)
st := d.GetStream()
if st != nil {
if st := d.GetStream(); st != nil {
t.Error("expected nil")
}
d.Reset()
@@ -91,24 +87,24 @@ func TestStream(t *testing.T) {
d.SortStream()
f = d.Next().(fakeDataHandler)
if f.time != 1 {
f, ok := d.Next().(fakeDataHandler)
if f.time != 1 || !ok {
t.Error("expected 1")
}
f = d.Next().(fakeDataHandler)
if f.time != 2 {
f, ok = d.Next().(fakeDataHandler)
if f.time != 2 || !ok {
t.Error("expected 2")
}
f = d.Next().(fakeDataHandler)
if f.time != 4 {
f, ok = d.Next().(fakeDataHandler)
if f.time != 4 || !ok {
t.Error("expected 4")
}
f = d.Next().(fakeDataHandler)
if f.time != 10 {
f, ok = d.Next().(fakeDataHandler)
if f.time != 10 || !ok {
t.Error("expected 10")
}
f = d.Next().(fakeDataHandler)
if f.time != 20 {
f, ok = d.Next().(fakeDataHandler)
if f.time != 20 || !ok {
t.Error("expected 20")
}
}

View File

@@ -81,8 +81,7 @@ func TestHasDataAtTime(t *testing.T) {
},
},
}
err := d.Load()
if err != nil {
if err := d.Load(); err != nil {
t.Error(err)
}