I'm new to go.
I have cloned this project: [oauth2_proxy][1] I'm wanting to add another provider. So I created the provider file in providers. Added the provider name to the providers switch statement. However, when I build the resulting binary, the provider keeps falling back to google.
It seems my provider has not been added. I suspect that go build might be pulling the providers from github and ignoring my local changes. Would that be right? How do you build this thing?
I'm building with go build because ./dist.sh script didn't work for me. I'm managing to produce a binary. But it doesn't appear my code file ended up in it. I know this because when I grep for "google" or "linkedin" or any of the provider names on the resulting binary it says: Binary file oauth2_proxy matches. But for my own provider, there is no match.
It's probably got something to do with the way I'm compiling the app. How do I do that? no instructions on the github page for doing that are provided. Sorry for my ignorance. I'm coming from a c++ background which is more logical. Go seems to pick up dependancies automagically!?
Following suggestions from @Topo
matthewh@xen:~/dev/oauth2_proxy$ export GOPATH=`pwd`
matthewh@xen:~/dev/oauth2_proxy$ rm -rf src
matthewh@xen:~/dev/oauth2_proxy$ go get ./...
go install: no install location for directory /home/matthewh/dev/oauth2_proxy outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /home/matthewh/dev/oauth2_proxy/api outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /home/matthewh/dev/oauth2_proxy/cookie outside GOPATH
For more details see: 'go help gopath'
go install: no install location for directory /home/matthewh/dev/oauth2_proxy/providers outside GOPATH
For more details see: 'go help gopath'
src/cloud.google.com/go/internal/retry.go:21:2: cannot find package "github.com/googleapis/gax-go" in any of:
/usr/local/go/src/github.com/googleapis/gax-go (from $GOROOT)
/home/matthewh/dev/oauth2_proxy/src/github.com/googleapis/gax-go (from $GOPATH)
src/google.golang.org/api/internal/settings.go:22:2: cannot find package "google.golang.org/grpc" in any of:
/usr/local/go/src/google.golang.org/grpc (from $GOROOT)
/home/matthewh/dev/oauth2_proxy/src/google.golang.org/grpc (from $GOPATH)
src/google.golang.org/api/transport/dial.go:30:2: cannot find package "google.golang.org/grpc/credentials" in any of:
/usr/local/go/src/google.golang.org/grpc/credentials (from $GOROOT)
...