feat: update go1.26

This commit is contained in:
耗子
2026-02-14 00:16:52 +08:00
parent da7c93308b
commit b8d2051e64
6 changed files with 14 additions and 24 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
module github.com/acepanel/panel
go 1.25.6
go 1.26.0
require (
github.com/DeRuina/timberjack v1.3.9
@@ -25,7 +25,7 @@ require (
github.com/hashicorp/go-version v1.8.0
github.com/leonelquinteros/gotext v1.7.2
github.com/lib/pq v1.11.2
github.com/libdns/alidns v1.0.6-beta.3.0.20260121104221-597b1e580e21
github.com/libdns/alidns v1.0.6
github.com/libdns/cloudflare v0.2.2
github.com/libdns/cloudns v1.1.0
github.com/libdns/gcore v0.0.0-20250427050847-9964da923833
+2 -2
View File
@@ -213,8 +213,8 @@ github.com/leonelquinteros/gotext v1.7.2 h1:bDPndU8nt+/kRo1m4l/1OXiiy2v7Z7dfPQ9+
github.com/leonelquinteros/gotext v1.7.2/go.mod h1:9/haCkm5P7Jay1sxKDGJ5WIg4zkz8oZKw4ekNpALob8=
github.com/lib/pq v1.11.2 h1:x6gxUeu39V0BHZiugWe8LXZYZ+Utk7hSJGThs8sdzfs=
github.com/lib/pq v1.11.2/go.mod h1:/p+8NSbOcwzAEI7wiMXFlgydTwcgTr3OSKMsD2BitpA=
github.com/libdns/alidns v1.0.6-beta.3.0.20260121104221-597b1e580e21 h1:BGtptgrEJGjDQz63r4xkcQ/2ERXpna9WVUtrTtmW8d0=
github.com/libdns/alidns v1.0.6-beta.3.0.20260121104221-597b1e580e21/go.mod h1:RECwyQ88e9VqQVtSrvX76o1ux3gQUKGzMgxICi+u7Ec=
github.com/libdns/alidns v1.0.6 h1:/Ii428ty6WHFJmE24rZxq2taq++gh7rf9jhgLfp8PmM=
github.com/libdns/alidns v1.0.6/go.mod h1:RECwyQ88e9VqQVtSrvX76o1ux3gQUKGzMgxICi+u7Ec=
github.com/libdns/cloudflare v0.2.2 h1:XWHv+C1dDcApqazlh08Q6pjytYLgR2a+Y3xrXFu0vsI=
github.com/libdns/cloudflare v0.2.2/go.mod h1:w9uTmRCDlAoafAsTPnn2nJ0XHK/eaUMh86DUk8BWi60=
github.com/libdns/cloudns v1.1.0 h1:W+1MadtxKySn3b5RITFTsXgTIvr5VoO5x97cewjlDcs=
+7 -14
View File
@@ -262,18 +262,16 @@ func (s *ToolboxMigrationService) Start(w http.ResponseWriter, r *http.Request)
return
}
now := time.Now()
s.state.Step = types.MigrationStepRunning
s.state.Items = req
s.state.Results = nil
s.state.Logs = nil
s.state.StartedAt = &now
s.state.StartedAt = new(time.Now())
s.state.EndedAt = nil
conn := *s.state.Connection
s.state.mu.Unlock()
// 异步执行迁移
go s.runMigration(&conn, req)
go s.runMigration(new(*s.state.Connection), req)
Success(w, nil)
}
@@ -412,10 +410,9 @@ func (s *ToolboxMigrationService) runMigration(conn *request.ToolboxMigrationCon
s.migrateProject(conn, &proj, items.StopOnMig)
}
now := time.Now()
s.state.mu.Lock()
s.state.Step = types.MigrationStepDone
s.state.EndedAt = &now
s.state.EndedAt = new(time.Now())
s.state.mu.Unlock()
s.addLog("===== " + s.t.Get("Migration completed") + " =====")
@@ -428,8 +425,7 @@ func (s *ToolboxMigrationService) migrateWebsite(conn *request.ToolboxMigrationC
Name: site.Name,
Status: types.MigrationItemRunning,
}
now := time.Now()
result.StartedAt = &now
result.StartedAt = new(time.Now())
s.addResult(result)
s.addLog(fmt.Sprintf("[%s] %s: %s", s.t.Get("Website"), s.t.Get("start migrating"), site.Name))
@@ -504,8 +500,7 @@ func (s *ToolboxMigrationService) migrateDatabase(conn *request.ToolboxMigration
Name: displayName,
Status: types.MigrationItemRunning,
}
now := time.Now()
result.StartedAt = &now
result.StartedAt = new(time.Now())
s.addResult(result)
s.addLog(fmt.Sprintf("[%s] %s: %s", s.t.Get("Database"), s.t.Get("start migrating"), displayName))
@@ -619,8 +614,7 @@ func (s *ToolboxMigrationService) migrateDatabaseUser(conn *request.ToolboxMigra
Name: displayName,
Status: types.MigrationItemRunning,
}
now := time.Now()
result.StartedAt = &now
result.StartedAt = new(time.Now())
s.addResult(result)
s.addLog(fmt.Sprintf("[%s] %s: %s", s.t.Get("Database User"), s.t.Get("start migrating"), displayName))
@@ -700,8 +694,7 @@ func (s *ToolboxMigrationService) migrateProject(conn *request.ToolboxMigrationC
Name: proj.Name,
Status: types.MigrationItemRunning,
}
now := time.Now()
result.StartedAt = &now
result.StartedAt = new(time.Now())
s.addResult(result)
s.addLog(fmt.Sprintf("[%s] %s: %s", s.t.Get("Project"), s.t.Get("start migrating"), proj.Name))
+1 -2
View File
@@ -84,8 +84,7 @@ func mergeRules(rules []FireInfo) []FireInfo {
existing.Protocol = ProtocolTCPUDP
}
} else {
clone := r
grouped[key] = &clone
grouped[key] = new(r)
order = append(order, key)
}
}
+1 -2
View File
@@ -157,8 +157,7 @@ func (t *Turn) Resize(rows, cols uint16) error {
// terminal which no longer has an open slave. So ignore error here.
// See https://github.com/creack/pty/issues/21
func IsPTYError(err error) error {
var pathErr *os.PathError
if !errors.As(err, &pathErr) || !errors.Is(pathErr.Err, syscall.EIO) || !errors.Is(err, io.EOF) {
if pathErr, ok := errors.AsType[*os.PathError](err); !ok || !errors.Is(pathErr.Err, syscall.EIO) || !errors.Is(err, io.EOF) {
return err
}
+1 -2
View File
@@ -85,8 +85,7 @@ func parseKey(key, passphrase string) (ssh.Signer, error) {
signer, err := ssh.ParsePrivateKey(keyBytes)
if err != nil {
// 密钥被加密
var passphraseMissingError *ssh.PassphraseMissingError
if errors.As(err, &passphraseMissingError) {
if passphraseMissingError, ok := errors.AsType[*ssh.PassphraseMissingError](err); ok {
return nil, passphraseMissingError
}
return nil, err