Standard library / go/doc/comment
go/doc/comment.LinkDef
Represents a named link definition and whether it is used. Expected stdout: 'Example true\n'.
Formal Syntax & Structure
go syntaxgo
type LinkDef struct { Text string URL string Used bool}Working Example
Example Snippetgo
package main
import ( "fmt" "go/doc/comment")
func main() { p := comment.Parser{} d := p.Parse("See [Example].\n\n[Example]: https://example.invalid\n") fmt.Println(d.Links[0].Text, d.Links[0].Used)}