Skip to content

Go lint naming compliance #53

@dghubble

Description

@dghubble

Is it an aim of protoc-gen-go to produce names which pass golint? In particular, I find it is not capitalizing abbreviations as I expect (Id vs ID).

A contrived example is

message Args {
  int64 id = 1;
  string api_endpoint = 2;
}

which produces

type Args struct {
    Id          int64  `protobuf:"varint,1,opt,name=id" json:"id,omitempty"`
    ApiEndpoint string `protobuf:"bytes,2,opt,name=api_endpoint" json:"api_endpoint,omitempty"`
}

I prefer the names ID and APIEndpoint which pass golint. Currently, I must wrap these public fields in getters and be sure to use them to avoid propagating use of the generated names throughout my codebase.

For this project, is passing golint a goal, a loose aspiration, or no stance?

Thanks a bunch for your work on this :)

Related:
golang/lint#89

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions