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

Use enumer to generate enum helpers #4494

Open
imiric opened this issue Nov 8, 2021 · 0 comments
Open

Use enumer to generate enum helpers #4494

imiric opened this issue Nov 8, 2021 · 0 comments

Comments

@imiric
Copy link
Contributor

imiric commented Nov 8, 2021

As mentioned in grafana/xk6-browser#65 (comment), instead of maintaining our own conversion maps and JSON marshalling implementations, we should use the enumer tool to do that for us.

We should add go:generate comments so that running go generate ./... will pick it up. See how this is done in k6:

//go:generate enumer -type=ResponseType -transform=snake -json -text -trimprefix ResponseType -output response_type_gen.go
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants