Overriding defaultBaseURL

16 views
Skip to first unread message

Mark Petrovic

unread,
May 18, 2016, 10:27:53 AM5/18/16
to go-github
Thank you for this Go binding to Github's API.

I'm curious as to how to override defaultBaseURL when creating a new Client.  I don't see a way to do this, but I may be missing something obvious.

Would someone be kind enough to share how you do this.

Many thanks.
Mark

Will Norris

unread,
May 18, 2016, 11:28:48 AM5/18/16
to Mark Petrovic, go-github
build a client the normal way, then set its BaseURL field:

client := github.NewClient(nil)
client.BaseURL, err := url.Parse("https://custom.base/")

There are a couple of other fields you can override as well: https://godoc.org/github.com/google/go-github/github#Client

--
You received this message because you are subscribed to the Google Groups "go-github" group.
To unsubscribe from this group and stop receiving emails from it, send an email to go-github+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Petrovic

unread,
May 18, 2016, 11:32:36 AM5/18/16
to go-github, mspet...@gmail.com
Got it.  Thank you kindly.
Reply all
Reply to author
Forward
0 new messages