This commit is contained in:
astaxie 2014-08-05 08:56:04 +08:00
parent c0d3cc6fc5
commit 2c420573d4
1 changed files with 3 additions and 1 deletions

View File

@ -65,7 +65,9 @@ func parserPkg(pkgRealpath, pkgpath string) error {
for _, d := range fl.Decls {
switch specDecl := d.(type) {
case *ast.FuncDecl:
parserComments(specDecl.Doc, specDecl.Name.String(), fmt.Sprint(specDecl.Recv.List[0].Type.(*ast.StarExpr).X), pkgpath)
if specDecl.Recv != nil {
parserComments(specDecl.Doc, specDecl.Name.String(), fmt.Sprint(specDecl.Recv.List[0].Type.(*ast.StarExpr).X), pkgpath)
}
}
}
}