Closed
Description
There are two issues with gen-accessors.go
generating accessors it should not be (/cc @gmlewis FYI). It's relatively harmless, but should be fixed.
First, gen-accessors.go does not skip unexported fields, which causes it to generate accessors that it shouldn't. For example:
// Getclient returns the client field.
func (s *service) Getclient() *Client {
if s == nil {
return nil
}
return s.client
}
Second, it does not skip certain structs that it should skip, including Client
, service
, and perhaps others. It should only generate accessors for structs that are mapped to GitHub objects. For example:
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
sahildua2305 commentedon Nov 14, 2017
@shurcooL I'd like to tackle this. What do you think about having an extended list of blacklisted structs to avoid while generating accessor methods?
dmitshur commentedon Nov 15, 2017
Thanks!
I think adding a list of blacklisted structs is the way to go. There's only a couple of them.
Remove generated accessors for Client struct and unexported fields. (#…
Remove generated accessors for Client struct and unexported fields. (g…