mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-08-04 06:36:24 +00:00
Clean up linter warnings
This commit is contained in:
parent
7b34c0603f
commit
63d974135b
2 changed files with 8 additions and 8 deletions
|
|
@ -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)
|
||||
err = fmt.Errorf("Timed out waiting for a response from kitty")
|
||||
}
|
||||
return
|
||||
return nil, err
|
||||
}
|
||||
if len(serialized_response) == 0 {
|
||||
if io_data.rc.NoResponse {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
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 {
|
||||
return nil
|
||||
return
|
||||
}
|
||||
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 {
|
||||
return os.ErrDeadlineExceeded
|
||||
}
|
||||
lp.AddTimer(io_data.timeout-time_since_last_received_data, false, check_for_timeout)
|
||||
return nil
|
||||
_, err = lp.AddTimer(io_data.timeout-time_since_last_received_data, false, check_for_timeout)
|
||||
return
|
||||
}
|
||||
|
||||
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)
|
||||
}
|
||||
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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue