alphabetical

package module
v0.0.0-...-149beb9 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2021 License: MIT Imports: 7 Imported by: 1

README

alphabetical

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"

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "alphabetical",
	Doc:      Doc,
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}
View Source
var Doc = `sort by alphabetical
// 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