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

generate const values for enumerations #140

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SoMuchForSubtlety
Copy link

This partly addresses #17 by generating const declarations for enums. I also fixed some linter errors.

Maybe we should omit numerical enums since they don't have useful names?

// May be one of 0.9, 0.333333333, 0.0
type FloatType float64

const (
	FloatType_0_9         FloatType = 0.9
	FloatType_0_333333333 FloatType = 0.333333333
	FloatType_0_0         FloatType = 0.0
)

// May be one of 1, 2, 3
type IntType int

const (
	IntType_1 IntType = 1
	IntType_2 IntType = 2
	IntType_3 IntType = 3
)

It would probably also make sense to gate this behind a config flag, what do you think?

@TAR5
Copy link

TAR5 commented Aug 14, 2023

Great feature!

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