Apply .gitignore rules

This commit is contained in:
皮蛋13361098506
2025-01-06 16:21:36 +08:00
parent 1b77f62820
commit ccd2c530cf
580 changed files with 69806 additions and 0 deletions

View File

@@ -0,0 +1,33 @@
package counter_util
import (
"fmt"
"testing"
"time"
)
func TestInfoLog(t *testing.T) {
var iserr bool = true
c := NewCounterUtil("test", 2, checkId, func(tag string, num int, ti time.Time) {
msg := fmt.Sprintf("tag:%s 当前数量为num:%v ti:%v", tag, num, ti)
if iserr {
t.Error(msg)
} else {
t.Log(msg)
}
})
c.AddNum(1)
iserr = false
c.AddNum(1)
time.Sleep(time.Second * 1)
iserr = true
c.AddNum(1)
time.Sleep(time.Second * 1)
c.AddNum(1)
}
func checkId(t1, t2 time.Time) bool {
return t1.Second() == t2.Second()
}