Clean up linter warnings

This commit is contained in:
Kovid Goyal 2024-03-05 08:27:13 +05:30
parent 7b34c0603f
commit 63d974135b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 8 deletions

View File

@ -225,7 +225,7 @@ func get_response(do_io func(io_data *rc_io_data) ([]byte, error), io_data *rc_i
_, _ = do_io(io_data) _, _ = do_io(io_data)
err = fmt.Errorf("Timed out waiting for a response from kitty") err = fmt.Errorf("Timed out waiting for a response from kitty")
} }
return return nil, err
} }
if len(serialized_response) == 0 { if len(serialized_response) == 0 {
if io_data.rc.NoResponse { if io_data.rc.NoResponse {

View File

@ -45,19 +45,19 @@ func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error)
var check_for_timeout func(timer_id loop.IdType) error var check_for_timeout func(timer_id loop.IdType) error
wants_streaming := false wants_streaming := false
check_for_timeout = func(timer_id loop.IdType) error { check_for_timeout = func(timer_id loop.IdType) (err error) {
if state != WAITING_FOR_RESPONSE && state != WAITING_FOR_STREAMING_RESPONSE { if state != WAITING_FOR_RESPONSE && state != WAITING_FOR_STREAMING_RESPONSE {
return nil return
} }
if io_data.on_key_event != nil { if io_data.on_key_event != nil {
return nil return
} }
time_since_last_received_data := time.Now().Sub(last_received_data_at) time_since_last_received_data := time.Since(last_received_data_at)
if time_since_last_received_data >= io_data.timeout { if time_since_last_received_data >= io_data.timeout {
return os.ErrDeadlineExceeded return os.ErrDeadlineExceeded
} }
lp.AddTimer(io_data.timeout-time_since_last_received_data, false, check_for_timeout) _, err = lp.AddTimer(io_data.timeout-time_since_last_received_data, false, check_for_timeout)
return nil return
} }
transition_to_read := func() { transition_to_read := func() {
@ -65,7 +65,7 @@ func do_chunked_io(io_data *rc_io_data) (serialized_response []byte, err error)
lp.Quit(0) lp.Quit(0)
} }
last_received_data_at = time.Now() last_received_data_at = time.Now()
lp.AddTimer(io_data.timeout, false, check_for_timeout) _, _ = lp.AddTimer(io_data.timeout, false, check_for_timeout)
} }
lp.OnReceivedData = func(data []byte) error { lp.OnReceivedData = func(data []byte) error {