S031

SchemasStandard

check for Schema of Computed only with MaxItems configured

The S031 analyzer reports cases of schemas which enables only Computed and configures MaxItems, which is not valid.

Examples

&schema.Schema{
    Computed: true,
    MaxItems: 1,
}
&schema.Schema{
    Computed: true,
}

Ignoring reports

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

//lintignore:S031
&schema.Schema{
    Computed: true,
    MaxItems: 1,
}

This page is generated from passes/S031/README.md, which lives beside the analyzer.