mirror of
https://github.com/kovidgoyal/kitty
synced 2026-06-08 22:28:24 +02:00
Couple more errors found by linting
This commit is contained in:
@@ -263,7 +263,7 @@ func get_password(password string, password_file string, password_env string, us
|
|||||||
}
|
}
|
||||||
ttyf, err := os.Open(tty.Ctermid())
|
ttyf, err := os.Open(tty.Ctermid())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
err = unix.Dup2(int(ttyf.Fd()), int(os.Stdin.Fd()))
|
err = unix.Dup2(int(ttyf.Fd()), int(os.Stdin.Fd())) //nolint ineffassign err is returned indicating duping failed
|
||||||
ttyf.Close()
|
ttyf.Close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,9 @@ func TestRCSerialization(t *testing.T) {
|
|||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
raw, err := io_data.serializer(&rc)
|
raw, err := io_data.serializer(&rc)
|
||||||
|
if err != nil {
|
||||||
|
t.Fatal(err)
|
||||||
|
}
|
||||||
var ec utils.EncryptedRemoteControlCmd
|
var ec utils.EncryptedRemoteControlCmd
|
||||||
err = json.Unmarshal([]byte(raw), &ec)
|
err = json.Unmarshal([]byte(raw), &ec)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
@@ -108,7 +108,6 @@ func simple_socket_io(conn *net.Conn, io_data *rc_io_data) (serialized_response
|
|||||||
const (
|
const (
|
||||||
BEFORE_FIRST_ESCAPE_CODE_SENT = iota
|
BEFORE_FIRST_ESCAPE_CODE_SENT = iota
|
||||||
SENDING
|
SENDING
|
||||||
WAITING_FOR_RESPONSE
|
|
||||||
)
|
)
|
||||||
state := BEFORE_FIRST_ESCAPE_CODE_SENT
|
state := BEFORE_FIRST_ESCAPE_CODE_SENT
|
||||||
|
|
||||||
@@ -124,7 +123,6 @@ func simple_socket_io(conn *net.Conn, io_data *rc_io_data) (serialized_response
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
if len(chunk) == 0 {
|
if len(chunk) == 0 {
|
||||||
state = WAITING_FOR_RESPONSE
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
err = write_many_to_conn(conn, []byte(cmd_escape_code_prefix), chunk, []byte(cmd_escape_code_suffix))
|
err = write_many_to_conn(conn, []byte(cmd_escape_code_prefix), chunk, []byte(cmd_escape_code_suffix))
|
||||||
|
|||||||
Reference in New Issue
Block a user