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

go vet swears to json "required" tag #397

Open
k0st1a opened this issue Apr 19, 2024 · 0 comments
Open

go vet swears to json "required" tag #397

k0st1a opened this issue Apr 19, 2024 · 0 comments

Comments

@k0st1a
Copy link

k0st1a commented Apr 19, 2024

There is a code:

type Register struct {
	Login       string `json:"login,required"`
}

After execute go vet -vettool=$$(which statictest) ./... appears error unknown JSON option "required"

May be added additional tag for this? For example:

type Register struct {
	Login       string `json:"login" easyjson:"required"`
}

Or use https://github.com/go-playground/validator ? Example:

type Register struct {
	Login       string `json:"login" validate:"required"`
}

P.S. In https://github.com/thriftrw/thriftrw-go/blob/dev/Makefile i found solution - filter errors from go vet.

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

No branches or pull requests

1 participant