XS002

SchemasExtra · tfsproutx

check for map[string]*Schema that keys are in alphabetical order

The XS002 analyzer reports cases of schemas where attributes are not listed in alphabetical order.

Examples

map[string]*schema.Schema{
    "name": { /* ... */ },
    "arn": { /* ... */ },
  },
}
map[string]*schema.Schema{
    "arn": { /* ... */ },
    "name": { /* ... */ },
  },
}

Ignoring reports

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

//lintignore:XS002
map[string]*schema.Schema{
    "name": { /* ... */ },
    "arn": { /* ... */ },
  },
}

This page is generated from xpasses/XS002/README.md, which lives beside the analyzer.