I usually use fmt.Errorf and the wrap directive, which allows me to check if a context compliant method has exited due to a closed context via err == context.Cancelled. Seems like I can't do this with `scany'.
Documents/cancelledContext % go run .
panic: scany: query one result row: context canceled
goroutine 1 [running]:
main.main()
~/Documents/cancelledContext/main.go:30 +0x385
exit status 2
I usually use
fmt.Errorf
and the wrap directive, which allows me to check if a context compliant method has exited due to a closed context viaerr == context.Cancelled
. Seems like I can't do this with `scany'.Reproducing minimal example:
accompanied
go.mod
:Upon running this I get: