rule

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package rule defines utility functions some revive rules can share.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasUpperCaseLetter added in v1.17.0

func HasUpperCaseLetter(s string) bool

HasUpperCaseLetter checks if a string contains at least one upper case letter.

func IsUpperCaseConst added in v1.17.0

func IsUpperCaseConst(s string) bool

IsUpperCaseConst checks if a string is in constant name format like `SOME_CONST`, `SOME_CONST_2`, `X123_3`, `_SOME_PRIVATE_CONST`. See #851, #865.

func IsUpperUnderscore added in v1.17.0

func IsUpperUnderscore(s string) bool

IsUpperUnderscore detects variable that are made from upper case letters, underscore, or digits.

Short variable names are considered OK.

func Name

func Name(name string, allowlist, blocklist []string, skipInitialismNameChecks bool) (should string)

Name returns a different name of struct, var, const, or function if it should be different.

Types

This section is empty.

Jump to

Keyboard shortcuts

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