Re: [go-nuts] Parsing comments that don't start with a space

2022-11-06 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2022-11-06 at 11:55 -0800, 'Christian Stewart' via golang-nuts wrote: >  - Why does the comment not appear unless I put a space before? (in > ast CommentMap) This is explained here https://pkg.go.dev/go/ast#CommentGroup.Text > Comment directives like "//line" and "//go:noinline" are also

[go-nuts] Parsing comments that don't start with a space

2022-11-06 Thread 'Christian Stewart' via golang-nuts
Hi all, I'm trying to use packages.Load to parse the following comment: // Thing does something. // //my:value do-something I'm trying to parse the my:value comment similar to go:embed. Interestingly the comment does not appear in the AST unless I put a space: // my:value do-something My ques