Skip to content

Commit 56894cd

Browse files
committed
add modules
1 parent baa090a commit 56894cd

File tree

5 files changed

+45
-8
lines changed

5 files changed

+45
-8
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
./bin/dbx
22
.DS_Store
3+
vendor

build_test.go

+3-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
package main
44

55
import (
6-
"go/ast"
7-
"go/importer"
86
"go/parser"
97
"go/token"
10-
"go/types"
118
"io/ioutil"
129
"os"
1310
"path/filepath"
1411
"runtime/debug"
1512
"testing"
1613

14+
"golang.org/x/tools/go/packages"
1715
"gopkg.in/spacemonkeygo/dbx.v1/testutil"
1816
)
1917

@@ -79,14 +77,11 @@ func testBuildFile(t *testutil.T, file string) {
7977

8078
t.Logf("[%s] parsing...", file)
8179
fset := token.NewFileSet()
82-
f, err := parser.ParseFile(fset, go_file, go_source, parser.AllErrors)
80+
_, err = parser.ParseFile(fset, go_file, go_source, parser.AllErrors)
8381
t.AssertNoError(err)
8482

8583
t.Logf("[%s] compiling...", file)
86-
config := types.Config{
87-
Importer: importer.Default(),
88-
}
89-
_, err = config.Check(dir, fset, []*ast.File{f}, nil)
84+
_, err = packages.Load(nil, go_file)
9085

9186
if d.has("fail") {
9287
t.AssertError(err, d.get("fail"))

dialects.go

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// +build dialects
2+
3+
package main
4+
5+
import (
6+
_ "github.com/lib/pq"
7+
_ "github.com/mattn/go-sqlite3"
8+
)

go.mod

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module gopkg.in/spacemonkeygo/dbx.v1
2+
3+
require (
4+
bitbucket.org/pkg/inflect v0.0.0-20130829110746-8961c3750a47
5+
github.com/jawher/mow.cli v1.0.4
6+
github.com/lib/pq v1.0.0
7+
github.com/mattn/go-sqlite3 v1.10.0
8+
github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1
9+
github.com/stretchr/testify v1.3.0 // indirect
10+
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 // indirect
11+
golang.org/x/tools v0.0.0-20190208185513-a3f91d6be4f3
12+
)

go.sum

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
bitbucket.org/pkg/inflect v0.0.0-20130829110746-8961c3750a47 h1:XDrztcXGcx7jow3UUE2dpYtdSWVUigoyn8G+shykEtw=
2+
bitbucket.org/pkg/inflect v0.0.0-20130829110746-8961c3750a47/go.mod h1:8Rt8gHhG+tKz8P3SoEzL/ZNVl25fPhMFKItv5HLIdtY=
3+
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
4+
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5+
github.com/jawher/mow.cli v1.0.4 h1:hKjm95J7foZ2ngT8tGb15Aq9rj751R7IUDjG+5e3cGA=
6+
github.com/jawher/mow.cli v1.0.4/go.mod h1:5hQj2V8g+qYmLUVWqu4Wuja1pI57M83EChYLVZ0sMKk=
7+
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
8+
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
9+
github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
10+
github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
11+
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
12+
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
13+
github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1 h1:xHQewZjohU9/wUsyC99navCjQDNHtTgUOM/J1jAbzfw=
14+
github.com/spacemonkeygo/errors v0.0.0-20171212215202-9064522e9fd1/go.mod h1:7NL9UAYQnRM5iKHUCld3tf02fKb5Dft+41+VckASUy0=
15+
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
16+
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
17+
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
18+
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006 h1:bfLnR+k0tq5Lqt6dflRLcZiz6UaXCMt3vhYJ1l4FQ80=
19+
golang.org/x/net v0.0.0-20190206173232-65e2d4e15006/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
20+
golang.org/x/tools v0.0.0-20190208185513-a3f91d6be4f3 h1:9KLrAbyec1NfdzgY6JoTY4qqBmwBuXgIztYudsVeoQ8=
21+
golang.org/x/tools v0.0.0-20190208185513-a3f91d6be4f3/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=

0 commit comments

Comments
 (0)