优化代码

This commit is contained in:
刘祥超
2024-05-11 09:23:54 +08:00
parent f5596b4f0c
commit 777bbdf50b
116 changed files with 175 additions and 161 deletions

View File

@@ -0,0 +1,29 @@
// Copyright 2021 Liuxiangchao iwind.liu@gmail.com. All rights reserved.
package goman_test
import (
"github.com/TeaOSLab/EdgeNode/internal/utils/goman"
"testing"
"time"
)
func TestNew(t *testing.T) {
goman.New(func() {
t.Log("Hello")
t.Log(goman.List())
})
time.Sleep(1 * time.Second)
t.Log(goman.List())
time.Sleep(1 * time.Second)
}
func TestNewWithArgs(t *testing.T) {
goman.NewWithArgs(func(args ...interface{}) {
t.Log(args[0], args[1])
}, 1, 2)
time.Sleep(1 * time.Second)
}