You can. It’s trivial once you know it’s possible. Not sure why it’s not set by default.
https://go.googlesource.com/net/+/master/http2/transport.go
You need a heartbeat or ping message together with an advancing deadline to detect dead peers reliably.