net/http: make ExampleGet show StatusCode checks for non-1XX,2XX responses
net/http: make ExampleGet show StatusCode checks for non-1XX,2XX responses

Updates ExampleGet to show how to handle bad responses with non-1XX,2XX
status codes. Given that the canonical examples are copied, we need
to have them properly check against failures. This is a bug I've seen
often in the wild, that's exacerbated when for example unmarshalling
JSON or even protobufs, and no errors are returned by the decoders,
so code fails silently after making a request for example to a gateway
that they were unauthorized to access.

Fixes #39778

Change-Id: I1cd688f2fab47581c8cf228235d3662b4c8e4315
Reviewed-on: https://go-review.googlesource.com/c/go/+/299609
Trust: Emmanuel Odeke <bd234ba4276433f0e5fc7a8fa2d18274fa711567@orijtech.com>
Run-TryBot: Emmanuel Odeke <bd234ba4276433f0e5fc7a8fa2d18274fa711567@orijtech.com>
TryBot-Result: Go Bot <66cb808b70d30c07676d5e946fee83fd561249e5@golang.org>
Reviewed-by: Damien Neil <7e091e9a80da888fcd7836fd3c6b7b85f4677c12@google.com>

nawawi/go,cloudflare/go,golang/go,cloudflare/go,golang/go,nawawi/go,CAFxX/go,golang/go,CAFxX/go,nawawi/go,cloudflare/go,golang/go,nawawi/go,nawawi/go,nawawi/go,nawawi/go,golang/go,cloudflare/go,CAFxX/go,cloudflare/go,nawawi/go,CAFxX/go,CAFxX/go,cloudflare/go,golang/go,CAFxX/go,CAFxX/go,CAFxX/go,golang/go,cloudflare/go,cloudflare/go,golang/go