Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capitalization for common initialisms? #156

Closed
bufdev opened this issue Mar 24, 2016 · 5 comments
Closed

Capitalization for common initialisms? #156

bufdev opened this issue Mar 24, 2016 · 5 comments

Comments

@bufdev
Copy link

bufdev commented Mar 24, 2016

I actually might be against this, I like that id maps to Id, urlmaps to Url, etc, but there's an issue that was filed over at protocolbuffers/protobuf#1321 so it's at least worth a discussion - any thoughts on changing the generator to output capitalizations for https://github.com/golang/lint/blob/master/lint.go#L719 ?

@dsymonds
Copy link
Contributor

No, we won't do this. There's a never-ending list, we'll get it wrong, and it's simpler to stick with the current mechanical translation. We don't hold machine-generated code to the same high standard as human-written code.

@sleaze
Copy link

sleaze commented Jun 25, 2017

But humans have to then consume and interact with this non-idiomatic machine-generated code.

It's not a never ending list - just put the initialisms from golint.

Refusing to acknowledge and / or fix this defect only ensures and forces that things continue to be generated in an ugly, non-compliant way, needlessly.

@manishrjain
Copy link

FWIW, I think Go linter should relax its rules on ID, URL etc. being capitalized.

@yaronsumel
Copy link

yaronsumel commented Jun 26, 2017

you can use github.com/gogo/protobuf

message C {
	optional int64 size = 1 [(gogoproto.customname) = "MySize"];
}
type C struct {
	MySize		*int64
}

@sleaze
Copy link

sleaze commented Jun 27, 2017

Thanks @yaronsumel , will give it a try.

jaytaylor added a commit to jaytaylor/andromeda that referenced this issue Jun 12, 2018
New domain object: ToCrawlEntry.

Using gogo because Google's go protobuf pkg may never be go-friendly,
see: golang/protobuf#156
@golang golang locked and limited conversation to collaborators Jun 26, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants