Skip to content
This repository has been archived by the owner on Feb 26, 2019. It is now read-only.

Commit

Permalink
Record error from fillPackage
Browse files Browse the repository at this point in the history
Fixes #531
  • Loading branch information
Edward Muller committed Feb 2, 2017
1 parent 47355da commit f15f6db
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#v79 (2017/02/01)

* Fixes #531: fullPackageInDir didn't capture the error from fillPackage()

#v78 (2017/01/19)

* Don't use build.ImportDir when discovering packages for the package spec. Fixes #529
Expand Down
2 changes: 1 addition & 1 deletion list.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func fullPackageInDir(dir string) (*build.Package, error) {
if pkg.Goroot {
pkg, err = build.ImportDir(pkg.Dir, 0)
} else {
fillPackage(pkg)
err = fillPackage(pkg)
}
if err == nil {
pkgCache[dir] = pkg
Expand Down
35 changes: 35 additions & 0 deletions save_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1538,6 +1538,41 @@ func TestSave(t *testing.T) {
},
},
},
{ // 39 - return errors from fillPackage: #531
cwd: "C",
args: []string{"./..."},
vendor: true,
start: []*node{
{
"C",
"",
[]*node{
{"C.go", pkg("C", "github.com/D"), nil},
{"vendor/github.com/D/D.go", pkg("D"), nil},
{"+git", "C1", nil},
},
},
{
"github.com/D",
"",
[]*node{
{"D.go", pkg("D"), nil},
{"+git", "D1", nil},
},
},
},
want: []*node{
{"C/C.go", pkg("C", "github.com/D"), nil},
{"C/vendor/github.com/D/D.go", pkg("D"), nil},
},
wdep: Godeps{
ImportPath: "C",
Packages: []string{"./..."},
Deps: []Dependency{
{ImportPath: "github.com/D", Comment: "D1"},
},
},
},
}

wd, err := os.Getwd()
Expand Down
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"strings"
)

const version = 78
const version = 79

var cmdVersion = &Command{
Name: "version",
Expand Down

0 comments on commit f15f6db

Please sign in to comment.