README ¶ readonly readonly checks assignment to package variables. package a var ( V1 int = 10 // OK - first assignment V2 int ) func init() { V1 = 20 // OK - in init V2 = 100 // OK - in init } func main() { V1 = 30 // NG V2 = 200 // NG // assign V2 = 300 // OK - explicit assign } Expand ▾ Collapse ▴ Documentation ¶ Index ¶ Constants Variables Constants ¶ View Source const Doc = `check for assignment package variables` Variables ¶ View Source var Analyzer = &analysis.Analyzer{ Name: "readonly", Doc: Doc, Run: run, Requires: []*analysis.Analyzer{ inspect.Analyzer, buildssa.Analyzer, commentmap.Analyzer, }, } Functions ¶ This section is empty. Types ¶ This section is empty. Source Files ¶ View all Source files readonly.go Directories ¶ Show internal Expand all Path Synopsis cmd readonly Click to show internal directories. Click to hide internal directories.