Source File
doc.go
Belonging Package
go/doc/comment
// Copyright 2022 The Go Authors. All rights reserved.// Use of this source code is governed by a BSD-style// license that can be found in the LICENSE file./*Package comment implements parsing and reformatting of Go doc comments,(documentation comments), which are comments that immediately precedea top-level declaration of a package, const, func, type, or var.Go doc comment syntax is a simplified subset of Markdown that supportslinks, headings, paragraphs, lists (without nesting), and preformatted text blocks.The details of the syntax are documented at https://go.dev/doc/comment.To parse the text associated with a doc comment (after removing comment markers),use a [Parser]:var p comment.Parserdoc := p.Parse(text)The result is a [*Doc].To reformat it as a doc comment, HTML, Markdown, or plain text,use a [Printer]:var pr comment.Printeros.Stdout.Write(pr.Text(doc))The [Parser] and [Printer] types are structs whose fields can bemodified to customize the operations.For details, see the documentation for those types.Use cases that need additional control over reformatting canimplement their own logic by inspecting the parsed syntax itself.See the documentation for [Doc], [Block], [Text] for an overviewand links to additional types.*/package comment
![]() |
The pages are generated with Golds v0.7.9-preview. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @zigo_101 (reachable from the left QR code) to get the latest news of Golds. |