boolname

package module
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 12 Imported by: 0

README

Documentation

Overview

Package boolname provides a go/analysis analyzer enforcing the gomatic Go boolean naming standard on struct fields and function parameters and results: bool and *bool names there carry an is/has/can/should/will predicate prefix, or an Enabled/Disabled flag suffix. Package-level and local variables, constants, and generic (~bool-constrained) type parameters are deliberately out of scope. For parameters and named results it offers a mechanical is-prefix rename fix.

Index

Constants

This section is empty.

Variables

View Source
var Analyzer = &analysis.Analyzer{
	Name:     "boolname",
	Doc:      "reports boolean struct fields, parameters, and results lacking an is/has/can/should/will prefix or an Enabled/Disabled suffix",
	Requires: []*analysis.Analyzer{inspect.Analyzer},
	Run:      run,
}

Analyzer reports boolean fields, parameters, and results that are not named as predicates or flags.

View Source
var Registration = goyze.Registration{
	Name:       "boolname",
	Categories: []goyze.Category{"naming"},
	URL:        "https://docs.gomatic.dev/yze/boolname",
	Analyzer:   Analyzer,
}

Registration declares this analyzer to the yze framework.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis
cmd
yze-go-boolname command
Command yze-go-boolname runs the boolname analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).
Command yze-go-boolname runs the boolname analyzer as a standalone go/analysis checker (text and -json output, and as a `go vet -vettool`).

Jump to

Keyboard shortcuts

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