Design of Go-Github Library
Usually, we write a client package to hide the logic about rpc to get the value, hide complex about network.
This article will based on the library of https://github.com/google/go-github to introduce useful experience when we want to design a client for results from the remote.
As usual, our client package needs to satisfy some requirements, which why we create a saperate package for it.
- we need to call many api from server, and most logics of them are duplicated.
- hide some duplicated work and could be reused by the caller.