zarldev / goenums

Type Safe Enum generator for Go
MIT License
222 stars 10 forks source link

Idea : parse the //go:embed to make up for the lack of « enum tags » #19

Open folays opened 6 months ago

folays commented 6 months ago

Not a bug per se, but an idea / suggestion ;

Instead of having to generate for making up to the lack of « enum tags » ;

The file could parse its own //go:embed in a init() at run tile to produce needed info.

As a library, you could ask your caller to call you with the []byte of its own //go:embed.

Yes, that’s Weird Stuff (tm), the code would parse itself at runtime to introspect itself.