2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 07:57:21 +08:00

fix: lint

This commit is contained in:
2025-04-05 20:10:53 +08:00
parent edb5e858e4
commit e6b3858937
15 changed files with 130 additions and 45 deletions

View File

@@ -203,7 +203,9 @@ func ExecfWithTTY(shell string, args ...any) (string, error) {
if err != nil {
return "", fmt.Errorf("run %s failed", shell)
}
defer f.Close()
defer func(f *os.File) {
_ = f.Close()
}(f)
if _, err = io.Copy(&out, f); ptyError(err) != nil {
return "", fmt.Errorf("run %s failed, out: %s, err: %w", shell, strings.TrimSpace(out.String()), err)