Help us shape the future of Go! Take the 2026 Go Developer Survey

names

package
v1.37.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LabelName

func LabelName(name string) string

LabelName cleans up a string to be used as a RFC 1123 Label name. It does not enforce the 63 character limit.

RFC 1123 Label name:

  • contain only lowercase alphanumeric characters or '-'
  • start with an alphanumeric character
  • end with an alphanumeric character

Examples:

  • myproject, MYPROJECT -> myproject
  • myProject, myProjecT, MyProject, MyProjecT -> my-project
  • my.project, My.Project, my-project, My-Project -> my-project

func ValidateLabelName

func ValidateLabelName(name string) error

ValidateLabelName checks if the given name is a valid RFC 1123 Label name.

func ValidateProjectName

func ValidateProjectName(name string) error

ValidateProjectName checks if the given name is a valid project name. Only lowercase letters, numbers, and - are allowed. And the first and last characters must be letters or numbers.

Types

This section is empty.

Jump to

Keyboard shortcuts

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