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

[Feature Request] Add support for string conversion from enum aliases #94

Open
janpfeifer opened this issue Sep 20, 2024 · 0 comments
Open

Comments

@janpfeifer
Copy link

Would it make sense to add support for enum aliases ?

Example:

type MyType int

const (
  A MyType = iota
  B
)

const (
  AlsoA = A
  BInSpanish = B
)

And then have a call to MyTypeString("AlsoA") -> A and MyTypeString("BInSpanish") -> B ?

My concrete use case: I'm adding support to various naming schemes for data types (dtype) for machine learning frameworks, see this file, and the community doesn't seem to agree on one naming convention for these things. I was hopping to leverage enumer to handle the conversion from string also for the aliases.

ps.: Btw, thanks for writing and maintaining enumer!

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

No branches or pull requests

1 participant