Couple more errors found by linting

This commit is contained in:
Kovid Goyal 2022-09-21 19:51:09 +05:30
parent 4b6bae576d
commit 7c41737370
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 4 additions and 3 deletions

View File

@ -263,7 +263,7 @@ func get_password(password string, password_file string, password_env string, us
}
ttyf, err := os.Open(tty.Ctermid())
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()
}
}

View File

@ -70,6 +70,9 @@ func TestRCSerialization(t *testing.T) {
t.Fatal(err)
}
raw, err := io_data.serializer(&rc)
if err != nil {
t.Fatal(err)
}
var ec utils.EncryptedRemoteControlCmd
err = json.Unmarshal([]byte(raw), &ec)
if err != nil {

View File

@ -108,7 +108,6 @@ func simple_socket_io(conn *net.Conn, io_data *rc_io_data) (serialized_response
const (
BEFORE_FIRST_ESCAPE_CODE_SENT = iota
SENDING
WAITING_FOR_RESPONSE
)
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
}
if len(chunk) == 0 {
state = WAITING_FOR_RESPONSE
break
}
err = write_many_to_conn(conn, []byte(cmd_escape_code_prefix), chunk, []byte(cmd_escape_code_suffix))