Skip to content

Latest commit

 

History

History

S008

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

S008

The S008 analyzer reports cases of TypeList or TypeSet schemas configuring Default, which will fail schema validation.

Flagged Code

&schema.Schema{
    Type:    schema.TypeList,
    Default: /* ... */,
}

&schema.Schema{
    Type:    schema.TypeSet,
    Default: /* ... */,
}

Passing Code

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

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

Ignoring Reports

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

//lintignore:S008
&schema.Schema{
    Type:    schema.TypeList,
    Default: /* ... */,
}