Update golangci-lint to v2

This commit is contained in:
世界
2025-08-13 22:42:54 +08:00
parent 043a2e7a07
commit 378e39f70c
20 changed files with 67 additions and 61 deletions

View File

@@ -313,7 +313,7 @@ func (g *URLTestGroup) Select(network string) (adapter.Outbound, bool) {
}
func (g *URLTestGroup) loopCheck() {
if time.Now().Sub(g.lastActive.Load()) > g.interval {
if time.Since(g.lastActive.Load()) > g.interval {
g.lastActive.Store(time.Now())
g.CheckOutbounds(false)
}
@@ -323,7 +323,7 @@ func (g *URLTestGroup) loopCheck() {
return
case <-g.ticker.C:
}
if time.Now().Sub(g.lastActive.Load()) > g.idleTimeout {
if time.Since(g.lastActive.Load()) > g.idleTimeout {
g.access.Lock()
g.ticker.Stop()
g.ticker = nil
@@ -360,7 +360,7 @@ func (g *URLTestGroup) urlTest(ctx context.Context, force bool) (map[string]uint
continue
}
history := g.history.LoadURLTestHistory(realTag)
if !force && history != nil && time.Now().Sub(history.Time) < g.interval {
if !force && history != nil && time.Since(history.Time) < g.interval {
continue
}
checked[realTag] = true