-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Install doesn't work #99
Comments
go mod is ok : ~/temp » go version
go version go1.12.7 darwin/amd64
~/temp » mkdir goqu
~/temp » cd goqu
~/temp/goqu » go mod init goqu
go: creating new go.mod: module goqu
~/temp/goqu » go get -u github.com/doug-martin/goqu/v7
go: finding golang.org/x/net latest
go: finding golang.org/x/crypto latest
go: finding golang.org/x/tools latest
go: finding golang.org/x/sync latest
go: finding golang.org/x/sys latest
------------------------------------------------------------
~/temp/goqu » cat go.mod
module goqu
go 1.12
require (
github.com/doug-martin/goqu/v7 v7.3.0 // indirect
github.com/golang/protobuf v1.3.2 // indirect
github.com/stretchr/objx v0.2.0 // indirect
golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4 // indirect
golang.org/x/net v0.0.0-20190628185345-da137c7871d7 // indirect
golang.org/x/sys v0.0.0-20190712062909-fae7ac547cb7 // indirect
golang.org/x/tools v0.0.0-20190711191110-9a621aea19f8 // indirect
)
~/temp/goqu » vim main.go
~/temp/goqu » go run main.go
SELECT "a", "b" FROM "a" [] <nil>
|
I added a note to the readme, I've only been using this package with go mod and had not tried it without. I ran a couple of tests this morning and with any go version >v1.10 I was able to
And then I ran this as a test to make sure everything was resolving correctly. package main
import (
"fmt"
"github.com/doug-martin/goqu"
// import the dialect
_ "github.com/doug-martin/goqu/dialect/mysql"
)
func main() {
// look up the dialect
dialect := goqu.Dialect("mysql")
// use dialect.From to get a dataset to build your SQL
ds := dialect.From("test").Where(goqu.Ex{"id": 10})
sql, args, err := ds.ToSQL()
if err != nil{
fmt.Println("An error occurred while generating the SQL", err.Error())
}else{
fmt.Println(sql, args)
}
} What is interesting is the Sorry about the confusion and I hope this helps. |
Thanks @doug-martin. Do you happen to know the fix for using dep? With this config: [[constraint]]
name = "github.com/doug-martin/goqu"
version = "^v7.3.0" I get this error:
|
@leebenson I havent tried to use it with dep yet. I'm out for the next week, so it will be a little bit before I can try it out. If you happen to figure it out if you could reply with your solution or create a PR adding instructions to the README and I will get that merged. |
Thanks @doug-martin. We've internally switched to using modules, so this is no longer relevant to us, but I appreciate you looking into it. Will close for now. |
Installation instructions in the doc don't work:
Produces:
This does work:
... but then the package paths are messed up, since
v7
doesn't exist.The text was updated successfully, but these errors were encountered: