S042¶
SchemasStandard
check for Schema of TypeList, TypeMap, or TypeSet with WriteOnly enabled
The S042 analyzer reports cases of TypeList, TypeMap, or TypeSet schemas
which enable WriteOnly, which will fail provider schema validation.
WriteOnly is only supported on primitive types.
Examples¶
Ignoring reports¶
Singular reports can be ignored by adding a //lintignore:S042 Go code comment at the end of the offending line or on the line immediately preceding, e.g.
//lintignore:S042
&schema.Schema{
Type: schema.TypeList,
Optional: true,
Elem: &schema.Schema{Type: schema.TypeString},
WriteOnly: true,
}
This page is generated from passes/S042/README.md, which lives beside the analyzer.