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 UserFlags constant types #937

Merged
merged 1 commit into from May 26, 2021

Conversation

zephyrtronium
Copy link
Contributor

Only UserFlagDiscordEmployee had type UserFlags. All other constants
defined in the same block were untyped integer constants.

This change makes all UserFlags constants have type UserFlags. The
primary impact is that godoc and pkg.go.dev should render these
constants under the documentation for UserFlags, rather than under
package-level constants.

Only UserFlagDiscordEmployee had type UserFlags. All other constants
defined in the same block were untyped integer constants.

This change makes all UserFlags constants have type UserFlags. The
primary impact is that godoc and pkg.go.dev should render these
constants under the documentation for UserFlags, rather than under
package-level constants.
@zephyrtronium
Copy link
Contributor Author

It occurs to me that, since these constants were untyped, they could be used in expressions with variables of types other than UserFlags. So, this might technically be a breaking change. It might be a better idea to drop this PR, then possibly create a new set of constants which will show up in the right place in documentation.

@CarsonHoffman
Copy link
Collaborator

You're technically correct, but this was clearly a bug. I think that fixing it supersedes concerns about a breaking change here (and part of typing constants is to help prevent type misuse by intermingling with other types, so I think that forcing current users to be explicit in their usage is worth preventing the cases where users are accidentally not explicit).

@CarsonHoffman CarsonHoffman merged commit f36553e into bwmarrin:master May 26, 2021
@FedorLap2006 FedorLap2006 added this to the v0.24.0 milestone Feb 27, 2022
@FedorLap2006 FedorLap2006 added the breaking changes Contains breaking changes. Should be reflected in the changelog label Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes Contains breaking changes. Should be reflected in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants