ci: add Lint check on commits (#1086)
* ci: add Lint check on commits * ci: fix Lint script error * test: fix go vet errors * test: fix go vet errors, remove gofumpt to check go vet * test: fix go vet errors, try gofumpt * test: fix go vet errors, try gofumpt, round 1 * test: fix go vet errors, try gofumpt, round 2 * ci: fix Lint errors
This commit is contained in:
@@ -6,9 +6,10 @@ package internal
|
||||
|
||||
import (
|
||||
context "context"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
connectivity "google.golang.org/grpc/connectivity"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MocketcdConn is a mock of etcdConn interface
|
||||
|
||||
@@ -5,8 +5,9 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
)
|
||||
|
||||
// MockUpdateListener is a mock of UpdateListener interface
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build linux || darwin
|
||||
// +build linux darwin
|
||||
|
||||
package fs
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build linux || darwin
|
||||
// +build linux darwin
|
||||
|
||||
package proc
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build debug
|
||||
// +build debug
|
||||
|
||||
package search
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package stat
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
//go:build linux
|
||||
// +build linux
|
||||
|
||||
package stat
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
mgo "github.com/globalsign/mgo"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockMgoCollection is a mock of MgoCollection interface
|
||||
|
||||
@@ -5,9 +5,10 @@
|
||||
package mongo
|
||||
|
||||
import (
|
||||
reflect "reflect"
|
||||
|
||||
bson "github.com/globalsign/mgo/bson"
|
||||
gomock "github.com/golang/mock/gomock"
|
||||
reflect "reflect"
|
||||
)
|
||||
|
||||
// MockIter is a mock of Iter interface
|
||||
|
||||
@@ -17,10 +17,11 @@ func TestPoolGet(t *testing.T) {
|
||||
ch := make(chan lang.PlaceholderType)
|
||||
|
||||
for i := 0; i < limit; i++ {
|
||||
var fail AtomicBool
|
||||
go func() {
|
||||
v := stack.Get()
|
||||
if v.(int) != 1 {
|
||||
t.Fatal("unmatch value")
|
||||
fail.Set(true)
|
||||
}
|
||||
ch <- lang.Placeholder
|
||||
}()
|
||||
@@ -30,6 +31,10 @@ func TestPoolGet(t *testing.T) {
|
||||
case <-time.After(time.Second):
|
||||
t.Fail()
|
||||
}
|
||||
|
||||
if fail.True() {
|
||||
t.Fatal("unmatch value")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user