Skip to content

Analyzer: check for possible assigning package variables

License

Notifications You must be signed in to change notification settings

gostaticanalysis/readonly

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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
}

About

Analyzer: check for possible assigning package variables

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages