package main
import (
"fmt"
"net/http"
"github.com/markbates/goth"
)
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.
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.
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.