defaulter-gen

command
v0.18.2-0...-866293b Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

defaulter-gen is a tool for auto-generating Defaulter functions.

Given a list of input directories, it will scan for top level types and generate efficient defaulters for an entire object from the sum of the SetDefault_* methods contained in the object tree.

Generation is governed by comment tags in the source. Any package may request defaulter generation by including one or more comment tags at the package comment level:

// +k8s:defaulter-gen=<field-name-to-flag>

which will create defaulters for any type that contains the provided field name (if the type has defaulters). Any type may request explicit defaulting by providing the comment tag:

// +k8s:defaulter-gen=true|false

An existing defaulter method (`SetDefaults_TYPE`) can provide the comment tag:

// +k8s:defaulter-gen=covers

to indicate that the defaulter does not or should not call any nested defaulters.

Jump to

Keyboard shortcuts

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