Paul 6 lat temu
rodzic
commit
29a36d17c8
2 zmienionych plików z 4 dodań i 3 usunięć
  1. 1
    0
      timeout/go.mod
  2. 3
    3
      timeout/run.go

+ 1
- 0
timeout/go.mod Wyświetl plik

@@ -0,0 +1 @@
1
+module git.links123.net/links123.com/pkg/timeout

+ 3
- 3
timeout/run.go Wyświetl plik

@@ -5,14 +5,14 @@ import (
5 5
 	"time"
6 6
 )
7 7
 
8
-type ExecuteChan struct {
8
+type executeChan struct {
9 9
 	c    chan bool
10 10
 	once sync.Once
11 11
 }
12 12
 
13
-// 返回函数f是否被运行
13
+//Run 返回函数f是否被运行
14 14
 func Run(limit time.Duration, f func()) bool {
15
-	ec := &ExecuteChan{c: make(chan bool), once: sync.Once{}}
15
+	ec := &executeChan{c: make(chan bool), once: sync.Once{}}
16 16
 	whether := true
17 17
 
18 18
 	go func() {