Commit e665a7dd authored by astaxie's avatar astaxie

Merge pull request #1367 from dvwallin/develop

added a check to parser to not panic (in develop)
parents 6e24b78b edbad607
...@@ -77,7 +77,10 @@ func parserPkg(pkgRealpath, pkgpath string) error { ...@@ -77,7 +77,10 @@ func parserPkg(pkgRealpath, pkgpath string) error {
switch specDecl := d.(type) { switch specDecl := d.(type) {
case *ast.FuncDecl: case *ast.FuncDecl:
if specDecl.Recv != nil { if specDecl.Recv != nil {
parserComments(specDecl.Doc, specDecl.Name.String(), fmt.Sprint(specDecl.Recv.List[0].Type.(*ast.StarExpr).X), pkgpath) exp, ok := specDecl.Recv.List[0].Type.(*ast.StarExpr) // Check that the type is correct first beforing throwing to parser
if ok {
parserComments(specDecl.Doc, specDecl.Name.String(), fmt.Sprint(exp.X), pkgpath)
}
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment