/top/
/new/
/best/
/ask/
/show/
/job/
^
slacker news
login
about
←back to thread
Go subtleties
(harrisoncramer.me)
235 points
darccio
| 3 comments |
13 Oct 25 07:42 UTC
|
HN request time: 0.005s
|
source
Show context
fweimer
◴[
22 Oct 25 15:54 UTC
]
No.
45671049
[source]
▶
>>45565793 (OP)
#
Isn't using time.After for timeouts a bit of an anti-pattern? There is no way to cancel the pending computation.
replies(1):
>>45671264
#
1.
Philip-J-Fry
◴[
22 Oct 25 16:07 UTC
]
No.
45671264
[source]
▶
>>45671049
#
This was fixed in Go 1.23
https://go.dev/doc/go1.23#timer-changes
They will get cleaned up.
replies(1):
>>45671846
#
ID:
GO
2.
fweimer
◴[
22 Oct 25 16:49 UTC
]
No.
45671846
[source]
▶
>>45671264 (TP)
#
I meant that the goroutine in the example keeps running. Often this contradicts the reason for having the timeout in the first place.
replies(1):
>>45673244
#
3.
Philip-J-Fry
◴[
22 Oct 25 18:30 UTC
]
No.
45673244
[source]
▶
>>45671846
#
I'm not sure what you mean? The examples all return from their function.
↑