Alternative to use simple pointers for struct fields

16 views
Skip to first unread message

Remy Loubradou

unread,
Jun 28, 2016, 12:15:11 PM6/28/16
to go-github
I'm building a client for a public API like Github and I'm using go-github client implementation as a model to build the go client.

I am a bit disappointed with the pointer field approach take by the library for all structs representing an entity of the API,
it is really inconvenient to have to wrap int and string into a function to get a pointer value to satisfy the struct definition. 

I read the issue https://github.com/google/go-github/issues/19 about this, I think I understand the pros & cons and why it had to change but I'm wondering about the approach suggested by Quinn https://github.com/google/go-github/issues/19#issuecomment-22151321 and the response of Will https://github.com/google/go-github/issues/19#issuecomment-22976895, particularly about using this method while keeping the type safety. Could you elaborate on this method ?
Reply all
Reply to author
Forward
0 new messages