Hi all,
Figured it out: the comments appear in the comment.List, but not comment.Text():
cmap := ast.NewCommentMap(fset, codeFile, codeFile.Comments)
for nod, comments := range cmap {
for _, comment := range comments {
comment.Text() // Does not contain comments w/o a space before the comment.
for _, elem := range comment.List {
elem.Text // - Contains the entire comment line: like: //my:foo
}
}
Thanks,
Christian Stewart