I'm running into a weird issue with the lib/pq GO Package.
When attempting to open a connection, I'm receiving the following error:
vendor/github.com/lib/pq/notify.go:790: undefined: time.Until
I checked my $GOROOT and it's set correctly. Until is defined inside of the Time package. All the other methods seem to be working correctly, it's just Until that is breaking the build.
My $GOPATH is set correctly as well.
I was see the minimum version lib/pq supports is 1.8, I'm using 1.11 For the life of me, I can't figure out what is causing it. After doing some research, it seems most people were able to fix this by upgrading, but I'm on the most recent version (and I'd rather not downgrade to fix).
Relevant GO environment information below:
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Jeff\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Jeff\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
My Project path is:
/c/Users/Jeff/go/src/github.com/project/m1
main.go is running the following (which is causing the error)
func initDB(){
var err error
db, err = sql.Open("postgres", "dbname=mydb sslmode=disable")
if err != nil {
panic(err)
}
}
Any help would be appreciated.