naming

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2026 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToGoFieldName

func ToGoFieldName(s string) string

ToGoFieldName converts any OpenAPI identifier to a valid Go exported identifier in PascalCase for use as a struct field name. Unlike ToGoName, it does not escape Go reserved words because struct fields are accessed via selectors (e.g., obj.Type) which never conflict with keywords.

func ToGoName

func ToGoName(s string) string

ToGoName converts any OpenAPI identifier to a valid Go exported identifier in PascalCase.

func ToGoParamName

func ToGoParamName(s string) string

ToGoParamName converts any OpenAPI identifier to a valid Go unexported identifier in camelCase.

Types

type Namer

type Namer struct {
	// contains filtered or unexported fields
}

Namer handles conversion of OpenAPI identifiers to Go identifiers and tracks used names to prevent collisions.

func NewNamer

func NewNamer() *Namer

func (*Namer) RegisterName

func (n *Namer) RegisterName(name string) string

RegisterName registers a name and returns it. If the name has already been registered, a numeric suffix is appended to make it unique.

Jump to

Keyboard shortcuts

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