requiredfields

package
v0.0.0-...-e8da2ea Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2025 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

requiredFields is a linter to check that fields that are marked as required are not pointers, and do not have the omitempty tag. The linter will check for fields that are marked as required using the +required marker, or the +kubebuilder:validation:Required marker.

The linter will suggest to remove the omitempty tag from fields that are marked as required, but have the omitempty tag. The linter will suggest to remove the pointer type from fields that are marked as required.

If you have a large, existing codebase, you may not want to automatically fix all of the pointer issues. In this case, you can configure the linter not to suggest fixing the pointer issues by setting the `pointerPolicy` option to `Warn`.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Initializer

func Initializer() initializer

Initializer returns the AnalyzerInitializer for this Analyzer so that it can be added to the registry.

Types

This section is empty.

Jump to

Keyboard shortcuts

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