Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
0.9.2
-
None
-
Patch Available
Description
In Go, as per https://github.com/golang/go/wiki/CodeReviewComments#initialisms, words in names that are initialisms or acronyms should have a consistent case.
For example, if you have a struct like:
struct InitialismsTest { 1: string user_id, 2: string server_url, }
One would expect it to compile to:
type InitialismsTest struct { UserID string `thrift:"user_id,1" json:"user_id"` ServerURL string `thrift:"server_url,2" json:"server_url"` }
Rather than:-
type InitialismsTest struct { UserId string `thrift:"user_id,1" json:"user_id"` ServerUrl string `thrift:"server_url,2" json:"server_url"` }
It would be pretty difficult to handle all cases of initialisms in the Go compiler of course, but there is a set of common initialisms that have been identified by the authors of Golint and could be handled relatively easily:- https://github.com/golang/lint/blob/master/lint.go#L692
Attachments
Issue Links
- breaks
-
THRIFT-3043 go compiler generator uses non C++98 code
- Closed
- is related to
-
THRIFT-3170 Initialism code in the Go compiler causes chaos
- Closed