ci: add reviewdog (#1096)

This commit is contained in:
Kevin Wan
2021-09-29 13:09:20 +08:00
committed by GitHub
parent 80e3407be1
commit 65905b914d
23 changed files with 46 additions and 86 deletions

View File

@@ -395,16 +395,16 @@ func assetEqual(t *testing.T, except, data interface{}) {
func TestStream_AnyMach(t *testing.T) {
assetEqual(t, false, Just(1, 2, 3).AnyMach(func(item interface{}) bool {
return 4 == item.(int)
return item.(int) == 4
}))
assetEqual(t, false, Just(1, 2, 3).AnyMach(func(item interface{}) bool {
return 0 == item.(int)
return item.(int) == 0
}))
assetEqual(t, true, Just(1, 2, 3).AnyMach(func(item interface{}) bool {
return 2 == item.(int)
return item.(int) == 2
}))
assetEqual(t, true, Just(1, 2, 3).AnyMach(func(item interface{}) bool {
return 2 == item.(int)
return item.(int) == 2
}))
}

View File

@@ -47,7 +47,6 @@ type (
done chan lang.PlaceholderType
rule RotateRule
compress bool
keepDays int
// can't use threading.RoutineGroup because of cycle import
waitGroup sync.WaitGroup
closeOnce sync.Once

View File

@@ -7,7 +7,9 @@ import (
)
func TestRefreshCpu(t *testing.T) {
assert.True(t, RefreshCpu() >= 0)
assert.NotPanics(t, func() {
RefreshCpu()
})
}
func BenchmarkRefreshCpu(b *testing.B) {

View File

@@ -19,10 +19,8 @@ func TestDoneChanDone(t *testing.T) {
waitGroup.Add(1)
go func() {
select {
case <-doneChan.Done():
waitGroup.Done()
}
<-doneChan.Done()
waitGroup.Done()
}()
for i := 0; i < 5; i++ {

View File

@@ -30,8 +30,6 @@ func TestSpinLockRace(t *testing.T) {
var wait sync.WaitGroup
wait.Add(1)
go func() {
lock.Lock()
lock.Unlock()
wait.Done()
}()
time.Sleep(time.Millisecond * 100)