Skip to content
This repository was archived by the owner on Jan 30, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions browser/mapping_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,19 @@ func toFirstLetterLower(s string) string {
// Special cases.
// Instead of loading up an acronyms list, just do this.
// Good enough for our purposes.
switch s {
default:
return strings.ToLower(s[:1]) + s[1:]
case "URL":
return "url"
case "JSON":
return "json"
case "JSONValue":
return "jsonValue"
special := map[string]string{
"JSON": "json",
"JSONValue": "jsonValue",
"URL": "url",
}
if v, ok := special[s]; ok {
return v
}
if s == "" {
return ""
}

return strings.ToLower(s[:1]) + s[1:]
}

// isCustomMapping returns true if the method is a custom mapping
Expand Down