A function or local variable is named with underscores instead of mixed caps

tx0/go:underscore-namestrictwarningstyle

What it finds

func parse_header() or max_size := 10: Go names are written in mixed caps, as in parseHeader and maxSize, throughout the standard library and the community, and golint-style tools and readers expect it.

Function names and the names of local variables and parameters that contain an underscore between letters or digits are reported. Test, benchmark, example and fuzz functions in test files, whose names may separate cases with underscores, and names of generated-looking constants in all caps are left alone, as are names of package-level variables and constants, which often mirror external names.

From the rule's source, underscore_name.rs.

Example from the rule's tests
package p var package_level = 1 func parse_header(raw string) string {tx0 reports: the function name parse_header uses underscores instead of mixed caps	max_size := 10tx0 reports: the variable name max_size uses underscores instead of mixed caps	_ = max_size	return raw}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the strict tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/go:underscore-name" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/go:underscore-name] reason="..."

tx0 explain tx0/go:underscore-name shows the same in the terminal. Found a false positive? Report it.