 <p>You can implement a wrapper for fb.App and override Session method to return IFbSession instead of Facebook.Session.</p> <pre><code>package main import fb "github.com/huandu/facebook" type IFbApp interface { ExchangeToken(string) (string, int, error) Session(string) IFbSession } type MockFbApp struct { IFbApp } func (myFbApp *MockFbApp) ExchangeToken(token string) (string, int, error) { return "exchangetoken", 1, nil } func (myFbApp *MockFbApp) Session(token string) IFbSession { return &amp;MyFbSession{} } type IFbSession interface { User() (string, error) Get(string, fb.Params) (fb.Result, error) } type MyFbSession struct { IFbSession } func (myFbSession *MyFbSession) User() (string, error) { return "userid", nil } func (myFbSession *MyFbSession) Get(path string, params fb.Params) (fb.Result, error) { return fb.Result{}, nil } type RealApp struct { *fb.App } func (myFbApp *RealApp) Session(token string) IFbSession { return myFbApp.App.Session(token) } func SomeMethod() { Facebook(&amp;MockFbApp{}) Facebook(&amp;RealApp{fb.New("appId", "appSecret")}) } func Facebook(fbI IFbApp) { fbI.ExchangeToken("sometokenhere") fbI.Session("session") } func main() { SomeMethod() } </code></pre>