Skip to content

Commit 6dde3ea

Browse files
committed
Lint the lint
1 parent 2883dca commit 6dde3ea

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

json-to-go.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -154,8 +154,8 @@ function jsonToGo(json, typename)
154154

155155
function toProperCase(str)
156156
{
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 = [
159159
"API", "ASCII", "CPU", "CSS", "DNS", "EOF", "GUID", "HTML", "HTTP",
160160
"HTTPS", "ID", "IP", "JSON", "LHS", "QPS", "RAM", "RHS", "RPC", "SLA",
161161
"SMTP", "SSH", "TCP", "TLS", "TTL", "UDP", "UI", "UID", "UUID", "URI",
@@ -164,11 +164,10 @@ function jsonToGo(json, typename)
164164

165165
return str.replace(/(^|[\s_-])([a-z]+)/g, function(unused, sep, frag)
166166
{
167-
if (commonInitialisms.indexOf(frag.toUpperCase()) >= 0) {
167+
if (commonInitialisms.indexOf(frag.toUpperCase()) >= 0)
168168
return sep + frag.toUpperCase();
169-
} else {
169+
else
170170
return sep + frag[0].toUpperCase() + frag.substr(1).toLowerCase();
171-
}
172171
});
173172
}
174173
}

0 commit comments

Comments
 (0)