Debian Codegraph @

src/go/doc/comment/testdata/README.md

raw
1 This directory contains test files (*.txt) for the comment parser.
2
3 The files are in [txtar format](https://pkg.go.dev/golang.org/x/tools/txtar).
4 Consider this example:
5
6 -- input --
7 Hello.
8 -- gofmt --
9 Hello.
10 -- html --
11 <p>Hello.
12 -- markdown --
13 Hello.
14 -- text --
15 Hello.
16
17 Each `-- name --` line introduces a new file with the given name.
18 The file named “input” must be first and contains the input to
19 [comment.Parser](https://pkg.go.dev/go/doc/comment/#Parser).
20
21 The remaining files contain the expected output for the named format generated by
22 [comment.Printer](https://pkg.go.dev/go/doc/comment/#Printer):
23 “gofmt” for Printer.Comment (Go comment format, as used by gofmt),
24 “html” for Printer.HTML, “markdown” for Printer.Markdown, and “text” for Printer.Text.
25 The format can also be “dump” for a textual dump of the raw data structures.
26
27 The text before the `-- input --` line, if present, is JSON to be unmarshaled
28 to initialize a comment.Printer. For example, this test case sets the Printer's
29 TextWidth field to 20:
30
31 {"TextWidth": 20}
32 -- input --
33 Package gob manages streams of gobs - binary values exchanged between an
34 Encoder (transmitter) and a Decoder (receiver).
35 -- text --
36 Package gob
37 manages streams
38 of gobs - binary
39 values exchanged
40 between an Encoder
41 (transmitter) and a
42 Decoder (receiver).