MCPcopy Index your code
hub / github.com/oapi-codegen/oapi-codegen / IsValidGoIdentity

Function IsValidGoIdentity

pkg/codegen/utils.go:744–750  ·  view source on GitHub ↗

IsValidGoIdentity checks if the given string can be used as a name of variable, constant, or type.

(str string)

Source from the content-addressed store, hash-verified

742// IsValidGoIdentity checks if the given string can be used as a
743// name of variable, constant, or type.
744func IsValidGoIdentity(str string) bool {
745 if IsGoIdentity(str) {
746 return false
747 }
748
749 return !IsPredeclaredGoIdentifier(str)
750}
751
752// SanitizeGoIdentifier replaces illegal runes in the given string so that
753// it is a valid Go identifier. Unlike SanitizeGoIdentity, it does not

Callers 1

SanitizeGoIdentityFunction · 0.85

Calls 2

IsGoIdentityFunction · 0.85

Tested by

no test coverage detected