-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Currently, we are using https://github.com/alvaroloes/enumer to semi-automatically generate some helper methods for a several enum
types we have in k6:
Line 31 in c09919b
go install github.com/alvaroloes/[email protected] |
Lines 12 to 13 in c09919b
//go:generate enumer -type=SystemTag -transform=snake -trimprefix=Tag -output system_tag_gen.go | |
type SystemTag uint32 |
Lines 34 to 35 in c09919b
//go:generate enumer -type=ExecutionStatus -trimprefix ExecutionStatus -output execution_status_gen.go | |
type ExecutionStatus uint32 |
(and others)
Unfortunately, it hasn't been updated since 2019, and the current version produces code that has linter errors. It's also produces some methods we don't really use in all types...
The active fork of that tool seems to be https://github.com/dmarkham/enumer, and it fixes some things. Unfortunately, it also makes the second problem even worse. For example, it adds lowercase support (dmarkham/enumer#22) in a way that can't be disabled (dmarkham/enumer#40), which is not something we necessarily want in all of our types... 😞