Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

html/template: export stripTags func from html.go #22639

Closed
anotherGoogleFan opened this issue Nov 9, 2017 · 2 comments
Closed

html/template: export stripTags func from html.go #22639

anotherGoogleFan opened this issue Nov 9, 2017 · 2 comments
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Suggested Issues that may be good for new contributors looking for work to do.

Comments

@anotherGoogleFan
Copy link

There is a very handy "stripTags" function in html/template
(http://golang.org/src/pkg/html/template/html.go) that's currently unexported(go 1.9.2). I cannot understand why such a useful function is unexported.

@mvdan
Copy link
Member

mvdan commented Nov 9, 2017

@anotherGoogleFan being agressive in what is exported is generally a bad idea. Once something is importable and released, it falls under the Go1 compatibility guarantee and it must be maintained with backwards compatibility.

There needs to be good reason for something to be exported in a package. In general, that means that it's very commonly useful and that it's non-trivial to do or get right otherwise. There are always the alternatives of third party libraries and copying the code yourself, if it remains unexported.

I'm not the one to decide what to do with it - I'm simply trying to explain the likely reason why it hasn't been exported.

@mvdan mvdan changed the title html/template: why method "stripTags" unexported in html.go html/template: export stripTags func from html.go Nov 9, 2017
@mvdan mvdan added Suggested Issues that may be good for new contributors looking for work to do. NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. labels Nov 9, 2017
@ianlancetaylor
Copy link
Contributor

stripTags doesn't really have anything to do with the html/template package. We aren't going to export it from there. I suggest that you copy it into a different package.

Closing.

@golang golang locked and limited conversation to collaborators Nov 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsDecision Feedback is required from experts, contributors, and/or the community before a change can be made. Suggested Issues that may be good for new contributors looking for work to do.
Projects
None yet
Development

No branches or pull requests

4 participants