Skip to content

Latest commit

 

History

History

XR002

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

XR002

The XR002 analyzer reports missing usage of Importer in resources.

Flagged Code

&schema.Resource{
    Create: /* ... */,
    Delete: /* ... */,
    Read:   /* ... */,
    Schema: /* ... */,
}

Passing Code

&schema.Resource{
    Create:   /* ... */,
    Delete:   /* ... */,
    Importer: &schema.ResourceImporter{/* ... */},
    Read:     /* ... */,
    Schema:   /* ... */,
}

Ignoring Reports

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

//lintignore:XR002
&schema.Resource{
    Create: /* ... */,
    Delete: /* ... */,
    Read: /* ... */,
}