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

fix: lint

This commit is contained in:
耗子
2023-07-25 23:36:33 +08:00
parent cc70ab1fde
commit 5ec6a88a60

View File

@@ -112,16 +112,14 @@ func (r *SshController) Session(ctx http.Context) {
}
defer ws.Close()
var config *ssh.SSHClientConfig
config = ssh.SSHClientConfigPassword(
config := ssh.SSHClientConfigPassword(
r.setting.Get(models.SettingKeySshHost)+":"+r.setting.Get(models.SettingKeySshPort),
r.setting.Get(models.SettingKeySshUser),
r.setting.Get(models.SettingKeySshPassword),
)
client, err := ssh.NewSSHClient(config)
if err != nil {
ws.WriteControl(websocket.CloseMessage,
_ = ws.WriteControl(websocket.CloseMessage,
[]byte(err.Error()), time.Now().Add(time.Second))
return
}
@@ -129,7 +127,7 @@ func (r *SshController) Session(ctx http.Context) {
turn, err := ssh.NewTurn(ws, client)
if err != nil {
ws.WriteControl(websocket.CloseMessage,
_ = ws.WriteControl(websocket.CloseMessage,
[]byte(err.Error()), time.Now().Add(time.Second))
return
}