xgotext: fixed parsing of error types
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/leonelquinteros/gotext"
|
"github.com/leonelquinteros/gotext"
|
||||||
@@ -78,6 +79,9 @@ func main() {
|
|||||||
// redefine alias with fake struct
|
// redefine alias with fake struct
|
||||||
alias := Fake2{}
|
alias := Fake2{}
|
||||||
alias.Get("3")
|
alias.Get("3")
|
||||||
|
|
||||||
|
err := errors.New("test")
|
||||||
|
fmt.Print(err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
// dummy function
|
// dummy function
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ func (g *GoFile) checkType(rawType types.Type) bool {
|
|||||||
return g.checkType(t.Elem())
|
return g.checkType(t.Elem())
|
||||||
|
|
||||||
case *types.Named:
|
case *types.Named:
|
||||||
if t.Obj().Pkg().Path() != "github.com/leonelquinteros/gotext" {
|
if t.Obj().Pkg() == nil || t.Obj().Pkg().Path() != "github.com/leonelquinteros/gotext" {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user