Skip to content

Commit

Permalink
Fix package resolution
Browse files Browse the repository at this point in the history
  • Loading branch information
vektah committed Feb 9, 2018
1 parent 41306cb commit 86cdf3a
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 33 deletions.
1 change: 0 additions & 1 deletion cmd/ggraphqlc/basedir.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ var templateDir = func() string {
for _, path := range strings.Split(gopath, ":") {
if path != "" {
abspath, _ := filepath.Abs(filepath.Join(path, "src", "github.com", "vektah", "graphql-go"))
fmt.Println(abspath)
if dirExists(abspath) {
return abspath
}
Expand Down
9 changes: 3 additions & 6 deletions cmd/ggraphqlc/extractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,10 @@ func (e *extractor) introspect() error {
if o.Type.Package == "" {
continue
}
pkgName, err := resolvePkg(o.Type.Package)
if err != nil {
return fmt.Errorf("unable to find package %s: %s", o.Type.Package, err.Error())
}
pkg := prog.Package(pkgName)

pkg := prog.Imported[o.Type.Package]
if pkg == nil {
return fmt.Errorf("required package was not loaded: %s", pkgName)
return fmt.Errorf("required package was not loaded: %s", o.Type.Package)
}

for astNode, object := range pkg.Defs {
Expand Down
13 changes: 0 additions & 13 deletions cmd/ggraphqlc/resolve18.go

This file was deleted.

13 changes: 0 additions & 13 deletions cmd/ggraphqlc/resolve19.go

This file was deleted.

0 comments on commit 86cdf3a

Please sign in to comment.