Skip to content

text/template/parse: backwards incompatible changes #25968

@dsnet

Description

@dsnet

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).

\cc @mvdan @robpike @cybrcodr @bradfitz

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsDecisionFeedback is required from experts, contributors, and/or the community before a change can be made.release-blocker

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions