Skip to main content
Commonmark migration
Source Link

You can simply pass an error to os.IsTimeout() and if it's a timeout returned by net/http then it will return true.

func IsTimeout(err error) bool

 

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred.

You can simply pass an error to os.IsTimeout() and if it's a timeout returned by net/http then it will return true.

func IsTimeout(err error) bool

 

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred.

You can simply pass an error to os.IsTimeout() and if it's a timeout returned by net/http then it will return true.

func IsTimeout(err error) bool

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred.

Source Link
Jimbo
  • 26.4k
  • 16
  • 91
  • 133

You can simply pass an error to os.IsTimeout() and if it's a timeout returned by net/http then it will return true.

func IsTimeout(err error) bool

IsTimeout returns a boolean indicating whether the error is known to report that a timeout occurred.