Skip to content

Conversation

@abice
Copy link
Owner

@abice abice commented Jan 28, 2023

Adds a Values() option, as well as a NoComments flag.

Values() will return a slice of possible values (the actual enum type).

NoComments will remove the auto generated comments for the enum values. If you specify comments on your enums, then those will still live on, but the auto generated portion will not. This has been particularly annoying when using go-swagger to generate a swagger doc from the generated code... as it interprets each comment as part of the value, and you get a weird looking description in your api doc. This option allows for those to be optional given the use.

fixes #157

@coveralls
Copy link

Coverage Status

Coverage: 92.679% (-1.3%) from 94.011% when pulling e999a31 on abice/addValues into 5354791 on master.

@abice abice merged commit 1e5efaa into master Jan 28, 2023
@abice abice deleted the abice/addValues branch January 28, 2023 23:57
@aucampia
Copy link

Thank you for this @abice

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.

Function for getting a list of values

4 participants