Rationale: Less maintenance burden and careful migration to H2 for existing apps.
New features should be opt-in for the developer, not forced down upon them.
Having and running an script adding a
"import _ "golang/x/net/http2" for all web services who need it, doesn't sound like rocket science to me.
I vote for (c) too, though isn't (d) the long-term plan anyway?
(c) has my vote.If I understand correctly, (b) and (c) will look the same to developers? (ie. the public API of net/http is the same either way?)
My initial feeling is that option a) is best. The others feel like
we're adding magic rather than respecting the language
as it is. We don't need another special package - surely
http2 can register itself with net/http? So import "net/http/http2"
anywhere in the program should be sufficient.
ISTM that c) is just allowing cyclic imports by another name.
Once could actually allow cyclic imports by making _ imports
special - don't count it as cycle if it goes through a _ import.
But that would break any number of tools in the ecosystem.
After a little reflection and a brief look through the code,
I'm inclined to question this statement:
> Edge (2) is fundamental. We can't implement http.Handler etc
> without the concrete *http.Request type, for instance.
Looking at the public API, the only things that fundamentally
require net/http are server.go and transport.go.
Other than that, we have uses of http.Header (aka textproto.MIMEHeader)
and http.StatusText (easy to factor out).
So my suggestion would be to export enough from net/http/internal/http2
that it's possible to implement ConfigureServer in terms of that.
Might that be possible?
I vote (a). The dream of saying "automatic http2" is just marketing. I'd prefer an explicit import _ "net/http2" or "x/net/http2"
(Hope these are appropriate remarks for the -dev group. It's about development of the language, even if I'm not a developer of the language.)As just a -nuts type developer, I'd vote a) followed by a well-understood (amongst the wider Go community) transition to d).Whose dream is it anyway?
Is the typical user of Go (developers using it to build things in their companies) particularly worried about alignment with Google initiatives like gRPC and such, or even transparent HTTP/2 everywhere? I'm not. I think HTTP/2 is neat but I don't mind the idea of consciously enabling it.
So, out of curiosity, how do you keep on evolving it now? Do you keep
on making changes to golang.org/x/net/http2,
and rerun the "bundler"
everytime ?
Or do you work directly on net/http/h2_bundle.go ?