mirror of
https://github.com/kovidgoyal/kitty.git
synced 2024-09-20 02:57:19 +03:00
Clean up linter warnings
This commit is contained in:
parent
7b34c0603f
commit
63d974135b
@ -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 {
|
||||||
|
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user