Standard library / go/doc/comment

go/doc/comment.Link

Represents a link to a URL. Expected stdout: 'https://example.invalid\n'.

Formal Syntax & Structure

go syntaxgo
type Link struct {  Auto bool  Text []Text  URL  string}

Working Example

Example Snippetgo
package main
import (  "fmt"  "go/doc/comment")
func main() {  x := comment.Link{URL: "https://example.invalid", Text: []comment.Text{comment.Plain("Example")}}  fmt.Println(x.URL)}
Go Reference