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

Fix deprecation comment for Command.SetOutput #2172

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

thaJeztah
Copy link
Contributor

Deprecation comments should be at the start of a paragraph 1, and because of that have a whitespace above them 2;

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

With the whitespace missing, some tools, including pkg.go.dev 3 don't detect it to be deprecated.

Before this patch:

Screenshot 2024-07-16 at 17 43 46 Screenshot 2024-07-16 at 17 43 37

With this patch:

Screenshot 2024-07-16 at 17 43 18 Screenshot 2024-07-16 at 17 43 27

Deprecation comments should be at the start of a paragraph [1], and because
of that have a whitespace above them [2];

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

With the whitespace missing, some tools, including pkg.go.dev [3] don't
detect it to be deprecated.

[1]: https://go.dev/wiki/Deprecated
[2]: https://go.dev/doc/comment#paragraphs
[3]: https://pkg.go.dev/github.com/spf13/[email protected]#Command.SetOutput

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Copy link
Collaborator

@marckhouzam marckhouzam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for figuring this out!

@marckhouzam marckhouzam merged commit 371ae25 into spf13:main Jul 16, 2024
18 checks passed
@marckhouzam marckhouzam added this to the 1.9.0 milestone Jul 16, 2024
@thaJeztah thaJeztah deleted the fix_deprecated_comments branch July 16, 2024 23:50
@thaJeztah
Copy link
Contributor Author

you're welcome! I actually came to the repo to open #2173, but then noticed the incorrect comment. I've had similar issues in various other repositories, and it's easy to overlook them because the work in most cases (without the whitespace), but then.. don't work in other cases 😄

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

Successfully merging this pull request may close these issues.

None yet

2 participants