-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Description
https://golang.org/cl/84480 deliberately makes some breaking API changes saying:
Modifying the text/template/parse package in a backwards incompatible
manner is acceptable, given that the package godoc clearly states that
it isn't intended for general use. It's the equivalent of an internal
package, back when internal packages didn't exist yet.
Additionally, the documentation in text/template/parse
says:
Clients should use those packages to construct templates rather than this one, which provides shared internal data structures not intended for general use.
Saying that the package is "not intended for general use" is not the same thing as "this package must not be used by any package other than text/template". As a result, there exist code that depends on the parse
package that are now broken by this change and I don't believe it is okay to break them.
According to the Go 1 compatibility document:
Go 1 defines two things: first, the specification of the language; and second, the specification of a set of core APIs, the "standard packages" of the Go library.
It isn't defined what the set of "standard packages" are, but unless an exception is provided, I think it is reasonable to expect that parse
is considered one of them (even with the disclaimer and even if this would have been an internal-only package had they existed when the standard library was first created).