Skip to content

Commit

Permalink
fix bug on 1.4.x with chained imports
Browse files Browse the repository at this point in the history
Chained imports in 1.4 lead to `runtime.Caller` returning a strange error condition where `ok` is true but `file` is improperly left at an initialization value.  This checks for that value and bails if it's found.
  • Loading branch information
jmoiron committed Feb 9, 2016
1 parent b152fd7 commit 797449f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions path.go
Expand Up @@ -17,6 +17,9 @@ var goPath string

func init() {
_, file, _, ok := runtime.Caller(0)
if file == "?" {
return
}
if ok {
// We know that the end of the file should be:
// github.com/juju/errors/path.go
Expand Down

0 comments on commit 797449f

Please sign in to comment.