Skip to content

go vet swears to json "required" tag #397

Description

@k0st1a

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions