From 2c420573d4f72aae8a559ab80220a3cf6c249394 Mon Sep 17 00:00:00 2001 From: astaxie Date: Tue, 5 Aug 2014 08:56:04 +0800 Subject: [PATCH] fix #703 --- parser.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/parser.go b/parser.go index 01df2c4a..0d3f6b84 100644 --- a/parser.go +++ b/parser.go @@ -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) + } } } }