Skip to content

Latest commit

 

History

History

S017

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

S017

The S017 analyzer reports cases of schemas including MaxItems or MinItems without TypeList, TypeMap, or TypeSet, which will fail schema validation.

Flagged Code

&schema.Schema{
    MaxItems: 1,
    Type:     schema.TypeString,
}

&schema.Schema{
    MinItems: 1,
    Type:     schema.TypeString,
}

Passing Code

&schema.Schema{
    Type: schema.TypeString,
}

Ignoring Reports

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,
}