C002

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

README

C002

C002 detects incompatible Required kubebuilder marker and omitemty golang tag.

// +kubebuilder:Required
Foo string `json:"foo,omitempty"`

The omitempty tag makes the field Foo optional regardless of the Required marker so this makes the code confusing.

Documentation

Index

Constants

View Source
const (
	Name = "C002"
	Doc  = "detects incompatible `Required` kubebuilder marker and `omitemty` golang tag"
)

Variables

This section is empty.

Functions

func NewAnalyzer

func NewAnalyzer() *analysis.Analyzer

Types

type Linter

type Linter struct {
	*b.BaseLinter
}

func (*Linter) LintFile

func (l *Linter) LintFile(file *ast.File) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL