I'm working on a project which uses the OAuth (code.google.com/p/goauth2/
oauth) and Google Calendar API
(code.google.com/p/google-api-go-client/calendar/v3) packages to
automatically create new events on a particular calendar. However I'm
running into some issues with the OAuth package failing certain operations
related to http.
Once authenticated with OAuth an http.Client is generated to use with with
any requests made to Google API's that support OAuth authentication. I'm
having some issues on my linux system with certain http operations failing
in the OAuth package and I want to "overload" the Get method on the
http.Client passed to the calendar service to write out diagnostics to a
What I want to do is "overload" the Get method of the http.Client that is
given to the calendar service to include some logging so I can see what
requests are being made and what their contents are. I'm not exactly sure
how to go about doing this. I've tried embedding the http.Client into a new
type and calling the embedded Get method before dumping the response to a
log file, but I can't pass this type to the calendar service initialization
method because it only accepts http.Client.
Am I thinking about this the right way and just missing some caveat or am I
going the complete wrong direction?