The S017 analyzer reports cases of schemas including MaxItems
or
MinItems
without TypeList
, TypeMap
, or TypeSet
, which will
fail schema validation.
&schema.Schema{
MaxItems: 1,
Type: schema.TypeString,
}
&schema.Schema{
MinItems: 1,
Type: schema.TypeString,
}
&schema.Schema{
Type: schema.TypeString,
}
Singular reports can be ignored by adding the a //lintignore:S017
Go code comment at the end of the offending line or on the line immediately proceding, e.g.
//lintignore:S017
&schema.Schema{
MaxItems: 1,
Type: schema.TypeString,
}