I have an idea for a minor addition I would like to make to the database/sql go package. I would like to try my change out to see how it works.
I thought that I would be able to execute this command to get a copy of the source in database/sql that I could play with:
go get github.com/golang/go/tree/master/src/database/sql
Then, I was going to change my import statement from
import "database/sql"
to
import "github.com/golang/go/tree/master/src/database/sql"
and put a debugging Printf in my local copy of the code to confirm that the new code I just pulled was being executed rather than the code in /usr/local/go.
When I try the "go get" command above, I get this error message:
$ go get github.com/golang/go/tree/master/src/database/sql
package github.com/golang/go/tree/master/src/database/sql: cannot find package "github.com/golang/go/tree/master/src/database/sql" in any of:
/usr/local/go/src/github.com/golang/go/tree/master/src/database/sql (from $GOROOT)
/Users/me/go/src/github.com/golang/go/tree/master/src/database/sql (from $GOPATH)
$ echo $GOPATH
/Users/me/go
$
Why doesn't this work?
I also tried doing this with the source at
https://go.googlesource.com/go/+/release-branch.go1.6/src/database/sql
That didn't work either. Then I tried downloading the tgz of the source from the link above, and untarring those files in my own $GOPATH/src/github.com/database/sql folder, then go building them there. That produced a sql.a that ran, but didn't work.