readonly

package module
v0.0.0-...-8e3cac1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 8, 2018 License: MIT Imports: 6 Imported by: 0

README

readonly

godoc.org

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
}

Documentation

Index

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, commentmap.Analyzer},
}

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL