S037

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: MPL-2.0 Imports: 2 Imported by: 0

README

S037

The S037 analyzer reports cases of Schemas which include ExactlyOneOf and have invalid schema attribute references.

NOTE: This only verifies the syntax of attribute references. The Terraform Plugin SDK can unit test attribute references to verify the references against the full schema.

Flagged Code

&schema.Schema{
    ExactlyOneOf: []string{"config_block_attr.nested_attr"},
}

Passing Code

&schema.Schema{
    ExactlyOneOf: []string{"config_block_attr.0.nested_attr"},
}

Ignoring Reports

Singular reports can be ignored by adding the a //lintignore:S037 Go code comment at the end of the offending line or on the line immediately proceding, e.g.

//lintignore:S037
&schema.Schema{
    ExactlyOneOf: []string{"config_block_attr.nested_attr"},
}

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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