naming

package
v0.18.0 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MethodName           = core.MethodName
	PackageName          = core.PackageName
	GoTypeName           = core.GoTypeName
	ProtocolGoTypeName   = core.ProtocolGoTypeName
	ExportedFunctionName = core.ExportedFunctionName
	ExportedTypeName     = core.ExportedTypeName
)

Shared naming helpers (identical across the purego/cgo pipelines) live in internal/codegen/naming/core and are re-exported here so existing callers keep using naming.MethodName / naming.ExportedTypeName / … unchanged.

Functions

func ClassVarName

func ClassVarName(className string) string

ClassVarName returns the package-level var name for a class reference. e.g. "NSString" → "_clsNSString"

func LowerFirst

func LowerFirst(s string) string

LowerFirst is the exported form of lowerFirst.

func ParamName

func ParamName(objcName string) string

ParamName sanitises an ObjC or C parameter name for use as a Go argument name: snake_case becomes camelCase (distributor_base_address → distributorBaseAddress) and a leading upper-case word is lowered as a unit (CPUCount → cpuCount, URLString → urlString, URLs → urls) rather than one letter at a time (never cPUCount). A name that would collide with a Go keyword, builtin, or common package name gets a trailing underscore.

func SelectorVarName

func SelectorVarName(className, selector string) string

SelectorVarName returns a lowercase Go identifier for a selector variable that is safe to use as a package-level var name within a class file. e.g. ("NSString", "uppercaseString") → "_nsstrSelUppercaseString"

Types

This section is empty.

Jump to

Keyboard shortcuts

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