Skip to content
This repository has been archived by the owner on Jan 16, 2021. It is now read-only.

Gray out deprecated symbols #456

Open
rakyll opened this issue Nov 7, 2016 · 3 comments
Open

Gray out deprecated symbols #456

rakyll opened this issue Nov 7, 2016 · 3 comments

Comments

@rakyll
Copy link
Contributor

rakyll commented Nov 7, 2016

If an exported symbol is deprecated, its godoc should be grayed out. Currently, there is no highlighting for deprecated symbols and users cannot easily they are depending on the legacy APIs.

@zombiezen
Copy link
Contributor

Haha, this is exactly the bug I was going to file. 👍

@dmitshur
Copy link
Contributor

dmitshur commented Nov 8, 2016

Implementation-wise, I see this being two parts.

First one is some general Go code to determine when a symbol is deprecated. It would have to match the rules that are set out for deprecating a symbol. Reference for that is here:

To signal that an identifier should not be used, add a paragraph to its doc comment that begins with "Deprecated:" followed by some information about the deprecation.

That should be relatively easy to implement, but does anyone know if this already exists anywhere?

Second part is making use of that to change presentation of such symbols on godoc.org.

@rakyll
Copy link
Contributor Author

rakyll commented Nov 8, 2016

Standard library and official packages use the "Deprecated:" notation, see "ErrWriteAfterFlush" at https://golang.org/pkg/net/http/ for an example. grep the Go tree for more examples.

As an example of a standalone deprecated symbol, see https://golang.org/pkg/net/http/#Transport.CancelRequest.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants