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

Method GoVariableName

pkg/codegen/operations.go:202–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

200}
201
202func (pd ParameterDefinition) GoVariableName() string {
203 name := LowercaseFirstCharacters(pd.GoName())
204 if IsGoKeyword(name) {
205 name = "p" + UppercaseFirstCharacter(name)
206 }
207 if unicode.IsNumber([]rune(name)[0]) {
208 name = "n" + name
209 }
210 return name
211}
212
213func (pd ParameterDefinition) GoName() string {
214 goName := pd.ParamName

Callers 2

genParamArgsFunction · 0.80
genParamNamesFunction · 0.80

Calls 4

GoNameMethod · 0.95
LowercaseFirstCharactersFunction · 0.85
IsGoKeywordFunction · 0.85
UppercaseFirstCharacterFunction · 0.85

Tested by

no test coverage detected