S016

SchemasStandard

check for Schema that Set is only configured for TypeSet

The S016 analyzer reports cases of schemas including Set without TypeSet, which will fail schema validation.

Examples

&schema.Schema{
    Set:  /* ... */,
    Type: schema.TypeList,
}
&schema.Schema{
    Set:  /* ... */,
    Type: schema.TypeSet,
}

Ignoring reports

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

//lintignore:S016
&schema.Schema{
    Set:  /* ... */,
    Type: schema.TypeList,
}

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