S019

SchemasStandard

check for Schema that should omit Computed, Optional, or Required set to false

The S019 analyzer reports cases of schemas including Computed: false, Optional: false, or Required: false which are extraneous.

Examples

&schema.Schema{
    Computed: false,
    Optional: true,
}

&schema.Schema{
    Optional: false,
    Required: true,
}

&schema.Schema{
    Computed: true,
    Required: false,
}
&schema.Schema{
    Optional: true,
}

&schema.Schema{
    Required: true,
}

&schema.Schema{
    Computed: true,
}

Ignoring reports

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

//lintignore:S019
&schema.Schema{
    Computed: false,
    Optional: true,
}

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