Skip to content

Latest commit

 

History

History

S023

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

S023

The S023 analyzer reports cases of schema including Elem that should be removed with incompatible Type.

Flagged Code

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeBool,
}

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeFloat,
}

&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeInt,
}

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

Passing Code

&schema.Schema{
  Type: TypeBool,
}

&schema.Schema{
  Type: TypeFloat,
}

&schema.Schema{
  Type: TypeInt,
}

&schema.Schema{
  Type: TypeString,
}

Ignoring Reports

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

//lintignore:S023
&schema.Schema{
  Elem: &schema.Schema{},
  Type: TypeBool,
}