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

@@ -73,8 +73,7 @@ func (g *GctScriptManager) Stop() error {
atomic.CompareAndSwapInt32(&g.started, 1, 0)
}()
err := g.ShutdownAll()
if err != nil {
if err := g.ShutdownAll(); err != nil {
return err
}
close(g.shutdown)

View File

@@ -37,6 +37,7 @@ func TestNewManager(t *testing.T) {
for _, tt := range tests {
tt := tt
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
got, err := NewManager(tt.args.config)
if (err != nil) != tt.wantErr {
t.Errorf("NewManager() error = %v, wantErr %v", err, tt.wantErr)

View File

@@ -279,7 +279,7 @@ func TestVMWithRunnerOnce(t *testing.T) {
config: configHelper(true, true, maxTestVirtualMachines),
started: 1,
}
vmCount := VMSCount.Len()
vmCount := VMSCount.Len() // nolint:ifshort,nolintlint // false positive and triggers only on Windows
VM := manager.New()
if VM == nil {
t.Fatal("Failed to allocate new VM exiting")
@@ -533,8 +533,7 @@ func TestVMLimit(t *testing.T) {
config: configHelper(true, false, 0),
started: 1,
}
testVM := manager.New()
if testVM != nil {
if testVM := manager.New(); testVM != nil {
t.Fatal("expected nil but received pointer to VM")
}
}