Skip to content

False positive for ignored field #83

@mitar

Description

@mitar

I have structs like:

type Build struct {
	Version        string `json:"version,omitempty"`
	BuildTimestamp string `json:"buildTimestamp,omitempty"`
	Revision       string `json:"revision,omitempty"`
}

type Site struct {
	Build *Build `json:"build,omitempty" yaml:"-"`

	Index string `json:"index" yaml:"index"`
	Title string `json:"title" yaml:"title"`

	SizeField bool `json:"-" yaml:"sizeField,omitempty"`
}

Linter complains that the given struct should be annotated with the yaml tag. It seems it is complaining that Build has no yaml tag, but it doe not need it because it is an ignored field for yaml, see yaml:"-" there.

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