-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Labels
Description
as part of resolving #19, all data structures now use pointer field values. To ease the burden on developers to constantly perform nil checks, we should generate Get*()
funcs on all our data structures, similar to what goprotobuf does. If a field is non-nil, return it. Otherwise, return the zero value for that type. So for example,
func (m *User) GetLogin() string {
if m != nil && m.Login != nil {
return *m.Login
}
return ""
}
Go provides good capabilities to read and manipulate go source code, so this can be completely generated. We might need to move all these types into a single data.go
file, I'm not sure.