S028

SchemasStandard

check for Schema of Computed only with DefaultFunc configured

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

Examples

&schema.Schema{
    Computed: true,
    DefaultFunc: /* ... */,
}
&schema.Schema{
    Computed: true,
}

Ignoring reports

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

//lintignore:S028
&schema.Schema{
    Computed: true,
    DefaultFunc: /* ... */,
}

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