Calling two different exposed functions in goth package. One works, the other yields "undefined: goth.ContextForClient" at compile-time

package main

import (


func main() {
	x := goth.GetProviders() // works
	a := goth.ContextForClient(http.DefaultClient) // fails with ./test.go:12: undefined: goth.ContextForClient
	fmt.Print(x, a)

This is the exact place were the functions are defined:

I have the same problem when trying to call HTTPClientWithFallBack. But any other function in that package works without issue.

What am I missing? Thank you!

If goth.HTTPClientWithFallBack doesnt work as well, try updating goth, those functions have been added in a commit about a year ago, maybe you still have an older version in your GOPATH or vendored.

1 Like

Thank you Norbert.

It was indeed a problem with the package in vendor folder not being the last version.
I kept looking at the package in GOPATH and couldn’t figure out why it was not working.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.