Overriding defaultBaseURL

Skip to first unread message

Mark Petrovic

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.

Will Norris

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

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
0 new messages