Add comments

This commit is contained in:
Harshavardhana
2015-03-03 01:25:45 -08:00
parent 721ec9ef5a
commit 137584d658
10 changed files with 66 additions and 77 deletions

View File

@@ -118,15 +118,19 @@ func doPackage(fs *token.FileSet, pkg *ast.Package) {
}
}
case *ast.FuncDecl:
// Skip if function is 'main'
// if function is 'main', never check
if n.Name.Name == "main" {
continue
}
// Skip non-exported functions
// Do not be strict on non-exported functions
if !ast.IsExported(n.Name.Name) {
continue
}
// Check if comments are missing from exported functions
// Do not be strict for field list functions
// if n.Recv != nil {
// continue
//}
// Be strict for global functions
_, ok := cmap[n]
if ok == false {
p.missingcomments[n.Name.Name] = n