alphabeticalorder

package module
v0.0.0-...-ce1cb25 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 8 Imported by: 0

README

alphabeticalorder

Check function call and variable declarations are in alphabetical order. The target is the statement with // Alphabetical order comments.

// Alphabetical order
var (
	Banana = "banana"
	Apple  = "apple" // want "not sort by alphabetical"
)

func f() {
	http.HandleFunc("/z", nil)

	// Alphabetical order
	http.HandleFunc("/b", nil)
	http.HandleFunc("/a", nil) // want "not sort by alphabetical"
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "alphabeticalorder",
	Doc:      Doc,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}
View Source
var Doc = `sort variable by alphabetical order
// Alphabetical order
above comment check.
`
View Source
var ErrNotAlphabeticalOrder = errors.New("not sort by alphabetical")

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