S020

SchemasStandard

check for Schema of Computed only with ForceNew enabled

The S020 analyzer reports cases of schemas which enables only Computed and enables ForceNew, which is invalid.

Examples

&schema.Schema{
    Computed: true,
    ForceNew: true,
}
&schema.Schema{
    Computed: true,
}

Ignoring reports

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

//lintignore:S020
&schema.Schema{
    Computed: true,
    ForceNew: true,
}

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