Skip to content

Latest commit

 

History

History

S001

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

S001

The S001 analyzer reports cases of TypeList or TypeSet schemas missing Elem, which will fail schema validation.

Flagged Code

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

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

Passing Code

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

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

Ignoring Reports

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

//lintignore:S001
&schema.Schema{
    Type: schema.TypeList,
}