Skip to content

Latest commit

 

History

History
33 lines (25 loc) · 620 Bytes

README.md

File metadata and controls

33 lines (25 loc) · 620 Bytes

S018

The S018 analyzer reports cases of Schema including MaxItems: 1 and Type: schema.TypeSet that should be simplified to Type: schema.TypeList.

Flagged Code

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

Passing Code

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

Ignoring Reports

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

//lintignore:S018
&schema.Schema{
    MaxItems: 1,
    Type:     schema.TypeSet,
}