mirror of
https://github.com/jackc/pgx.git
synced 2025-04-27 13:14:32 +00:00
Fix docs for Timeout
This commit is contained in:
parent
035868ca0c
commit
416f037e77
@ -20,7 +20,7 @@ func SafeToRetry(err error) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Timeout checks if err was was caused by a timeout. To be specific, it is true if err is or was caused by a
|
// Timeout checks if err was was caused by a timeout. To be specific, it is true if err is or was caused by a
|
||||||
// context.Canceled, context.Canceled or an implementer of net.Error where Timeout() is true.
|
// context.Canceled, context.DeadlineExceeded or an implementer of net.Error where Timeout() is true.
|
||||||
func Timeout(err error) bool {
|
func Timeout(err error) bool {
|
||||||
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
if errors.Is(err, context.Canceled) || errors.Is(err, context.DeadlineExceeded) {
|
||||||
return true
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user