@@ -154,8 +154,8 @@ function jsonToGo(json, typename)
154
154
155
155
function toProperCase ( str )
156
156
{
157
- // see github.com/golang/lint/lint.go
158
- var commonInitialisms = [
157
+ // https:// github.com/golang/lint/blob/39d15d55e9777df34cdffde4f406ab27fd2e60c0/ lint.go#L695-L731
158
+ var commonInitialisms = [
159
159
"API" , "ASCII" , "CPU" , "CSS" , "DNS" , "EOF" , "GUID" , "HTML" , "HTTP" ,
160
160
"HTTPS" , "ID" , "IP" , "JSON" , "LHS" , "QPS" , "RAM" , "RHS" , "RPC" , "SLA" ,
161
161
"SMTP" , "SSH" , "TCP" , "TLS" , "TTL" , "UDP" , "UI" , "UID" , "UUID" , "URI" ,
@@ -164,11 +164,10 @@ function jsonToGo(json, typename)
164
164
165
165
return str . replace ( / ( ^ | [ \s _ - ] ) ( [ a - z ] + ) / g, function ( unused , sep , frag )
166
166
{
167
- if ( commonInitialisms . indexOf ( frag . toUpperCase ( ) ) >= 0 ) {
167
+ if ( commonInitialisms . indexOf ( frag . toUpperCase ( ) ) >= 0 )
168
168
return sep + frag . toUpperCase ( ) ;
169
- } else {
169
+ else
170
170
return sep + frag [ 0 ] . toUpperCase ( ) + frag . substr ( 1 ) . toLowerCase ( ) ;
171
- }
172
171
} ) ;
173
172
}
174
173
}
0 commit comments