S021

SchemasStandard

check for Schema that should omit ComputedWhen

The S021 analyzer reports cases of schemas including ComputedWhen, which should be removed.

Examples

&schema.Schema{
    Computed:     true,
    ComputedWhen: []string{"another_attr"},
}
&schema.Schema{
    Computed: true,
}

Ignoring reports

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

//lintignore:S021
&schema.Schema{
    Computed:     true,
    ComputedWhen: []string{"another_attr"},
}

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