diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/README.md b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d6f2c549605d2aae2eae1d3ba5ee3d5fce30da7e --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/README.md @@ -0,0 +1,42 @@ +This directory contains test files (*.txt) for the comment parser. + +The files are in [txtar format](https://pkg.go.dev/golang.org/x/tools/txtar). +Consider this example: + + -- input -- + Hello. + -- gofmt -- + Hello. + -- html -- +
Hello. + -- markdown -- + Hello. + -- text -- + Hello. + +Each `-- name --` line introduces a new file with the given name. +The file named “input” must be first and contains the input to +[comment.Parser](https://pkg.go.dev/go/doc/comment/#Parser). + +The remaining files contain the expected output for the named format generated by +[comment.Printer](https://pkg.go.dev/go/doc/comment/#Printer): +“gofmt” for Printer.Comment (Go comment format, as used by gofmt), +“html” for Printer.HTML, “markdown” for Printer.Markdown, and “text” for Printer.Text. +The format can also be “dump” for a textual dump of the raw data structures. + +The text before the `-- input --` line, if present, is JSON to be unmarshalled +to initialize a comment.Printer. For example, this test case sets the Printer's +TextWidth field to 20: + + {"TextWidth": 20} + -- input -- + Package gob manages streams of gobs - binary values exchanged between an + Encoder (transmitter) and a Decoder (receiver). + -- text -- + Package gob + manages streams + of gobs - binary + values exchanged + between an Encoder + (transmitter) and a + Decoder (receiver). diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/blank.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/blank.txt new file mode 100644 index 0000000000000000000000000000000000000000..9049fde76ed387b0520220b79f881eb1d7221454 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/blank.txt @@ -0,0 +1,12 @@ +-- input -- + $ + Blank line at start and end. + $ +-- gofmt -- +Blank line at start and end. +-- text -- +Blank line at start and end. +-- markdown -- +Blank line at start and end. +-- html -- +
Blank line at start and end. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code.txt new file mode 100644 index 0000000000000000000000000000000000000000..06b1519574c75c3b8fe2ebcbeace7a5f3b0555ac --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code.txt @@ -0,0 +1,94 @@ +-- input -- +Text. + A tab-indented + (no, not eight-space indented) + code block and haiku. +More text. + One space + is + enough + to + start + a + block. +More text. + + Blocks + can + + have + blank + lines. +-- gofmt -- +Text. + + A tab-indented + (no, not eight-space indented) + code block and haiku. + +More text. + + One space + is + enough + to + start + a + block. + +More text. + + Blocks + can + + have + blank + lines. +-- markdown -- +Text. + + A tab-indented + (no, not eight-space indented) + code block and haiku. + +More text. + + One space + is + enough + to + start + a + block. + +More text. + + Blocks + can + + have + blank + lines. +-- html -- +
Text. +
A tab-indented +(no, not eight-space indented) +code block and haiku. ++
More text. +
One space + is + enough + to + start + a + block. ++
More text. +
Blocks + can + +have + blank + lines. +diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code2.txt new file mode 100644 index 0000000000000000000000000000000000000000..0810bed41c2079682b95f791ac1dae1f0e0894a4 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code2.txt @@ -0,0 +1,31 @@ +-- input -- +Text. + + A tab-indented + (no, not eight-space indented) + code block and haiku. + +More text. +-- gofmt -- +Text. + + A tab-indented + (no, not eight-space indented) + code block and haiku. + +More text. +-- markdown -- +Text. + + A tab-indented + (no, not eight-space indented) + code block and haiku. + +More text. +-- html -- +
Text. +
A tab-indented +(no, not eight-space indented) +code block and haiku. ++
More text. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code3.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code3.txt new file mode 100644 index 0000000000000000000000000000000000000000..4a96a0e9ab9e83f9601a1bec6ef018690a376163 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code3.txt @@ -0,0 +1,33 @@ +-- input -- +Text. + + $ + A tab-indented + (surrounded by more blank lines) + code block and haiku. + $ + +More text. +-- gofmt -- +Text. + + A tab-indented + (surrounded by more blank lines) + code block and haiku. + +More text. +-- markdown -- +Text. + + A tab-indented + (surrounded by more blank lines) + code block and haiku. + +More text. +-- html -- +
Text. +
A tab-indented +(surrounded by more blank lines) +code block and haiku. ++
More text. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code4.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code4.txt new file mode 100644 index 0000000000000000000000000000000000000000..f128c9aeff72d371b257a59c6c54200f824addec --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code4.txt @@ -0,0 +1,38 @@ +-- input -- +To test, run this command: + go test -more + +Or, to test specific things, run this command: + +go test -more \ + -pkg first/package \ + -pkg second/package \ + -pkg third/package + +Happy testing! +-- gofmt -- +To test, run this command: + + go test -more + +Or, to test specific things, run this command: + + go test -more \ + -pkg first/package \ + -pkg second/package \ + -pkg third/package + +Happy testing! +-- markdown -- +To test, run this command: + + go test -more + +Or, to test specific things, run this command: + + go test -more \ + -pkg first/package \ + -pkg second/package \ + -pkg third/package + +Happy testing! diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code5.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code5.txt new file mode 100644 index 0000000000000000000000000000000000000000..0e340dd129838231be264bcf6eb89e267f3ca299 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code5.txt @@ -0,0 +1,21 @@ +-- input -- +L1 +L2 +L3 +L4 +L5 +- L6 { + L7 +} +L8 +-- gofmt -- +L1 +L2 +L3 +L4 +L5 + - L6 { + L7 + } + +L8 diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code6.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code6.txt new file mode 100644 index 0000000000000000000000000000000000000000..d2915d10680158fa9b8002fd79d799e2057f0358 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/code6.txt @@ -0,0 +1,24 @@ +-- input -- +Run this program: + +func main() { + fmt.Println("hello, world") +} + +Or this: + +go func() { + fmt.Println("hello, world") +}() +-- gofmt -- +Run this program: + + func main() { + fmt.Println("hello, world") + } + +Or this: + + go func() { + fmt.Println("hello, world") + }() diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/crash1.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/crash1.txt new file mode 100644 index 0000000000000000000000000000000000000000..6bb2f6fdda1f4dc7063e72d6bd0145dcddbb5f03 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/crash1.txt @@ -0,0 +1,16 @@ +-- input -- +[] + +[]: http:// +-- gofmt -- +[] + +[]: http:// +-- html -- +
+-- markdown -- +[](http://) +-- text -- + + +[]: http:// diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink.txt new file mode 100644 index 0000000000000000000000000000000000000000..a9323471fd450a2aa3a522c447978e29a46691ca --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink.txt @@ -0,0 +1,21 @@ +-- input -- +In this package, see [Doc] and [Parser.Parse]. +There is no [Undef] or [Undef.Method]. +See also the [comment] package, +especially [comment.Doc] and [comment.Parser.Parse]. +-- gofmt -- +In this package, see [Doc] and [Parser.Parse]. +There is no [Undef] or [Undef.Method]. +See also the [comment] package, +especially [comment.Doc] and [comment.Parser.Parse]. +-- text -- +In this package, see Doc and Parser.Parse. There is no [Undef] or +[Undef.Method]. See also the comment package, especially comment.Doc and +comment.Parser.Parse. +-- markdown -- +In this package, see [Doc](#Doc) and [Parser.Parse](#Parser.Parse). There is no \[Undef] or \[Undef.Method]. See also the [comment](/go/doc/comment) package, especially [comment.Doc](/go/doc/comment#Doc) and [comment.Parser.Parse](/go/doc/comment#Parser.Parse). +-- html -- +
In this package, see Doc and Parser.Parse. +There is no [Undef] or [Undef.Method]. +See also the comment package, +especially comment.Doc and comment.Parser.Parse. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink2.txt new file mode 100644 index 0000000000000000000000000000000000000000..ecd8e4e0bce4fab044d0ad912af6613ff80cc3be --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink2.txt @@ -0,0 +1,8 @@ +-- input -- +We use [io.Reader] a lot, and also a few map[io.Reader]string. + +Never [io.Reader]int or Slice[io.Reader] though. +-- markdown -- +We use [io.Reader](/io#Reader) a lot, and also a few map\[io.Reader]string. + +Never \[io.Reader]int or Slice\[io.Reader] though. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink3.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink3.txt new file mode 100644 index 0000000000000000000000000000000000000000..0ccfb3df70826fcae93076f71fd486afc116bd10 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink3.txt @@ -0,0 +1,8 @@ +-- input -- +[encoding/json.Marshal] is a doc link. + +[rot13.Marshal] is not. +-- markdown -- +[encoding/json.Marshal](/encoding/json#Marshal) is a doc link. + +\[rot13.Marshal] is not. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink4.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink4.txt new file mode 100644 index 0000000000000000000000000000000000000000..c7095276bfea309f5e0d5f99d65df5999d6e7d17 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink4.txt @@ -0,0 +1,7 @@ +-- input -- +[io] at start of comment. +[io] at start of line. +At end of line: [io] +At end of comment: [io] +-- markdown -- +[io](/io) at start of comment. [io](/io) at start of line. At end of line: [io](/io) At end of comment: [io](/io) diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink5.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink5.txt new file mode 100644 index 0000000000000000000000000000000000000000..ac7b3ae100d80dd3f3adbca724ea1e0dac8fbffc --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink5.txt @@ -0,0 +1,5 @@ +{"DocLinkBaseURL": "https://pkg.go.dev"} +-- input -- +[encoding/json.Marshal] is a doc link. +-- markdown -- +[encoding/json.Marshal](https://pkg.go.dev/encoding/json#Marshal) is a doc link. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink6.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink6.txt new file mode 100644 index 0000000000000000000000000000000000000000..1acd03b61639b676b64665eea86e6621c89d9826 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink6.txt @@ -0,0 +1,5 @@ +{"DocLinkBaseURL": "https://go.dev/pkg/"} +-- input -- +[encoding/json.Marshal] is a doc link, and so is [rsc.io/quote.NonExist]. +-- markdown -- +[encoding/json.Marshal](https://go.dev/pkg/encoding/json/#Marshal) is a doc link, and so is [rsc.io/quote.NonExist](https://go.dev/pkg/rsc.io/quote/#NonExist). diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink7.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink7.txt new file mode 100644 index 0000000000000000000000000000000000000000..d34979a3854572c08fd7422f5063d0aa7301d15e --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/doclink7.txt @@ -0,0 +1,4 @@ +-- input -- +You see more [*bytes.Buffer] than [bytes.Buffer]. +-- markdown -- +You see more [\*bytes.Buffer](/bytes#Buffer) than [bytes.Buffer](/bytes#Buffer). diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/escape.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/escape.txt new file mode 100644 index 0000000000000000000000000000000000000000..f54663f5c3ea58bedb356244ef6e8d361f554ed8 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/escape.txt @@ -0,0 +1,55 @@ +-- input -- +What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>? + ++ Line + +- Line + +* Line + +999. Line + +## Line +-- gofmt -- +What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>? + ++ Line + +- Line + +* Line + +999. Line + +## Line +-- text -- +What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>? + ++ Line + +- Line + +* Line + +999. Line + +## Line +-- markdown -- +What the ~!@#$%^&\*()\_+-=\`{}|\[]\\:";',./\<>? + +\+ Line + +\- Line + +\* Line + +999\. Line + +\## Line +-- html -- +
What the ~!@#$%^&*()_+-=`{}|[]\:";',./<>? +
+ Line +
- Line +
* Line +
999. Line +
## Line diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head.txt new file mode 100644 index 0000000000000000000000000000000000000000..b99a8c59f3fe7192a4d01cada9dbbe506a937226 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head.txt @@ -0,0 +1,92 @@ +-- input -- +Some text. + +An Old Heading + +Not An Old Heading. + +And some text. + +# A New Heading. + +And some more text. + +# Not a heading, +because text follows it. + +Because text precedes it, +# not a heading. + +## Not a heading either. + +-- gofmt -- +Some text. + +# An Old Heading + +Not An Old Heading. + +And some text. + +# A New Heading. + +And some more text. + +# Not a heading, +because text follows it. + +Because text precedes it, +# not a heading. + +## Not a heading either. + +-- text -- +Some text. + +# An Old Heading + +Not An Old Heading. + +And some text. + +# A New Heading. + +And some more text. + +# Not a heading, because text follows it. + +Because text precedes it, # not a heading. + +## Not a heading either. + +-- markdown -- +Some text. + +### An Old Heading {#hdr-An_Old_Heading} + +Not An Old Heading. + +And some text. + +### A New Heading. {#hdr-A_New_Heading_} + +And some more text. + +\# Not a heading, because text follows it. + +Because text precedes it, # not a heading. + +\## Not a heading either. + +-- html -- +
Some text. +
Not An Old Heading. +
And some text. +
And some more text. +
# Not a heading, +because text follows it. +
Because text precedes it, +# not a heading. +
## Not a heading either. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head2.txt new file mode 100644 index 0000000000000000000000000000000000000000..d3576325e04998274c8caf6cc8fe94370382d43f --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head2.txt @@ -0,0 +1,36 @@ +-- input -- +✦ + +Almost a+heading + +✦ + +Don't be a heading + +✦ + +A.b is a heading + +✦ + +A. b is not a heading + +✦ +-- gofmt -- +✦ + +Almost a+heading + +✦ + +Don't be a heading + +✦ + +# A.b is a heading + +✦ + +A. b is not a heading + +✦ diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head3.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head3.txt new file mode 100644 index 0000000000000000000000000000000000000000..dbb7cb3ffb8d2d089e551ecc264fdb54270510e0 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/head3.txt @@ -0,0 +1,7 @@ +{"HeadingLevel": 5} +-- input -- +# Heading +-- markdown -- +##### Heading {#hdr-Heading} +-- html -- +
Hello, +world +
This is +a test. +-- markdown -- +Hello, world + +This is a test. +-- text -- +Hello, world + +This is a test. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link.txt new file mode 100644 index 0000000000000000000000000000000000000000..551e3065ce79add68ec539de1e981334ae423dbb --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link.txt @@ -0,0 +1,17 @@ +-- input -- +The Go home page is https://go.dev/. +It used to be https://golang.org. + +-- gofmt -- +The Go home page is https://go.dev/. +It used to be https://golang.org. + +-- text -- +The Go home page is https://go.dev/. It used to be https://golang.org. + +-- markdown -- +The Go home page is [https://go.dev/](https://go.dev/). It used to be [https://golang.org](https://golang.org). + +-- html -- +
The Go home page is https://go.dev/. +It used to be https://golang.org. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link2.txt new file mode 100644 index 0000000000000000000000000000000000000000..8637a32f01ab752baf2f764b41608bfcb8f68f54 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link2.txt @@ -0,0 +1,31 @@ +-- input -- +The Go home page is https://go.dev/. +It used to be https://golang.org. +https:// is not a link. +Nor is https:// +https://☺ is not a link. +https://:80 is not a link. + +-- gofmt -- +The Go home page is https://go.dev/. +It used to be https://golang.org. +https:// is not a link. +Nor is https:// +https://☺ is not a link. +https://:80 is not a link. + +-- text -- +The Go home page is https://go.dev/. It used to be https://golang.org. https:// +is not a link. Nor is https:// https://☺ is not a link. https://:80 is not a +link. + +-- markdown -- +The Go home page is [https://go.dev/](https://go.dev/). It used to be [https://golang.org](https://golang.org). https:// is not a link. Nor is https:// https://☺ is not a link. https://:80 is not a link. + +-- html -- +
The Go home page is https://go.dev/. +It used to be https://golang.org. +https:// is not a link. +Nor is https:// +https://☺ is not a link. +https://:80 is not a link. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link3.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link3.txt new file mode 100644 index 0000000000000000000000000000000000000000..5a115b5cb7199b79cce4877a02c4e4aa748ba705 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link3.txt @@ -0,0 +1,14 @@ +-- input -- +Doc text. + +[Go home page]: https://go.dev +-- gofmt -- +Doc text. + +[Go home page]: https://go.dev +-- text -- +Doc text. +-- markdown -- +Doc text. +-- html -- +
Doc text. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link4.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link4.txt new file mode 100644 index 0000000000000000000000000000000000000000..75f194c845c2ecc879ef44165d1025adea10f559 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link4.txt @@ -0,0 +1,77 @@ +-- input -- +These are not links. + +[x + +[x]: + +[x]:https://go.dev + +[x]https://go.dev + +[x]: surprise://go.dev + +[x]: surprise! + +But this is, with a tab (although it's unused). + +[z]: https://go.dev +-- gofmt -- +These are not links. + +[x + +[x]: + +[x]:https://go.dev + +[x]https://go.dev + +[x]: surprise://go.dev + +[x]: surprise! + +But this is, with a tab (although it's unused). + +[z]: https://go.dev +-- text -- +These are not links. + +[x + +[x]: + +[x]:https://go.dev + +[x]https://go.dev + +[x]: surprise://go.dev + +[x]: surprise! + +But this is, with a tab (although it's unused). +-- markdown -- +These are not links. + +\[x + +\[x]: + +\[x]:[https://go.dev](https://go.dev) + +\[x][https://go.dev](https://go.dev) + +\[x]: surprise://go.dev + +\[x]: surprise! + +But this is, with a tab (although it's unused). +-- html -- +
These are not links. +
[x +
[x]: +
[x]:https://go.dev +
[x]https://go.dev +
[x]: surprise://go.dev +
[x]: surprise! +
But this is, with a tab (although it's unused). diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link5.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link5.txt new file mode 100644 index 0000000000000000000000000000000000000000..b4fb5889f47dca450da55ccf5b76850ad4a56640 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link5.txt @@ -0,0 +1,36 @@ +-- input -- +See the [Go home page] and the [pkg +site]. + +[Go home page]: https://go.dev/ +[pkg site]: https://pkg.go.dev +[Go home page]: https://duplicate.ignored + +They're really great! + +-- gofmt -- +See the [Go home page] and the [pkg +site]. + +They're really great! + +[Go home page]: https://go.dev/ +[pkg site]: https://pkg.go.dev + +[Go home page]: https://duplicate.ignored + +-- text -- +See the Go home page and the pkg site. + +They're really great! + +[Go home page]: https://go.dev/ +[pkg site]: https://pkg.go.dev +-- markdown -- +See the [Go home page](https://go.dev/) and the [pkg site](https://pkg.go.dev). + +They're really great! +-- html -- +
See the Go home page and the pkg +site. +
They're really great! diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link6.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link6.txt new file mode 100644 index 0000000000000000000000000000000000000000..ff629b4573653da1d801d1050756878745d9bc17 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link6.txt @@ -0,0 +1,50 @@ +-- input -- +URLs with punctuation are hard. +We don't want to consume the end-of-sentence punctuation. + +For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries). +And https://example.com/[foo]/bar{. +And https://example.com/(foo)/bar! +And https://example.com/{foo}/bar{. +And https://example.com/)baz{foo}. + +[And https://example.com/]. + +-- gofmt -- +URLs with punctuation are hard. +We don't want to consume the end-of-sentence punctuation. + +For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries). +And https://example.com/[foo]/bar{. +And https://example.com/(foo)/bar! +And https://example.com/{foo}/bar{. +And https://example.com/)baz{foo}. + +[And https://example.com/]. + +-- text -- +URLs with punctuation are hard. We don't want to consume the end-of-sentence +punctuation. + +For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries). +And https://example.com/[foo]/bar{. And https://example.com/(foo)/bar! And +https://example.com/{foo}/bar{. And https://example.com/)baz{foo}. + +[And https://example.com/]. + +-- markdown -- +URLs with punctuation are hard. We don't want to consume the end-of-sentence punctuation. + +For example, [https://en.wikipedia.org/wiki/John\_Adams\_(miniseries)](https://en.wikipedia.org/wiki/John_Adams_(miniseries)). And [https://example.com/\[foo]/bar](https://example.com/[foo]/bar){. And [https://example.com/(foo)/bar](https://example.com/(foo)/bar)! And [https://example.com/{foo}/bar](https://example.com/{foo}/bar){. And [https://example.com/](https://example.com/))baz{foo}. + +\[And [https://example.com/](https://example.com/)]. + +-- html -- +
URLs with punctuation are hard. +We don't want to consume the end-of-sentence punctuation. +
For example, https://en.wikipedia.org/wiki/John_Adams_(miniseries). +And https://example.com/[foo]/bar{. +And https://example.com/(foo)/bar! +And https://example.com/{foo}/bar{. +And https://example.com/)baz{foo}. +
[And https://example.com/]. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link7.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link7.txt new file mode 100644 index 0000000000000000000000000000000000000000..89a8b3170e0116b92d2dfd260d9b1c56eee0632f --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/link7.txt @@ -0,0 +1,25 @@ +-- input -- +[math] is a package but this is not a doc link. + +[io] is a doc link. + +[math]: https://example.com +-- gofmt -- +[math] is a package but this is not a doc link. + +[io] is a doc link. + +[math]: https://example.com +-- text -- +math is a package but this is not a doc link. + +io is a doc link. + +[math]: https://example.com +-- markdown -- +[math](https://example.com) is a package but this is not a doc link. + +[io](/io) is a doc link. +-- html -- +
math is a package but this is not a doc link. +
io is a doc link. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/linklist.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/linklist.txt new file mode 100644 index 0000000000000000000000000000000000000000..baf40624b345d26b9ce49ffe1c8fbff32bc2750c --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/linklist.txt @@ -0,0 +1,18 @@ +{"DocLinkBaseURL": "https://pkg.go.dev"} +-- input -- +Did you know? + + - [encoding/json.Marshal] is a doc link. So is [encoding/json.Unmarshal]. +-- text -- +Did you know? + + - encoding/json.Marshal is a doc link. So is encoding/json.Unmarshal. +-- markdown -- +Did you know? + + - [encoding/json.Marshal](https://pkg.go.dev/encoding/json#Marshal) is a doc link. So is [encoding/json.Unmarshal](https://pkg.go.dev/encoding/json#Unmarshal). +-- html -- +
Did you know? +
Did you know? +
testing.T is one doc link. +
So is testing.M. +
So is testing.B. +This is the same list paragraph. +
There is testing.PB in this list item, too! +
Cool things: +
Cool things: +
Foo +
Go is great +
Bar +
Text. +- Not a list. +
More text. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list10.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list10.txt new file mode 100644 index 0000000000000000000000000000000000000000..9c490834560c40fdbba606c33ac88cdf8e5d9e7a --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list10.txt @@ -0,0 +1,13 @@ +-- input -- + + 1. This list + 2. Starts the comment + 3. And also has a blank line before it. + +All of which is a little weird. +-- gofmt -- + 1. This list + 2. Starts the comment + 3. And also has a blank line before it. + +All of which is a little weird. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list2.txt new file mode 100644 index 0000000000000000000000000000000000000000..c390b3d59a5bb3b2e1f5f28736f82acb51b04fd8 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list2.txt @@ -0,0 +1,57 @@ +-- input -- +Text. + 1. Uno + 2) Dos + 3. Tres + 5. Cinco + 7. Siete + 11. Once + 12. Doce + 13. Trece. + +-- gofmt -- +Text. + 1. Uno + 2. Dos + 3. Tres + 5. Cinco + 7. Siete + 11. Once + 12. Doce + 13. Trece. + +-- text -- +Text. + 1. Uno + 2. Dos + 3. Tres + 5. Cinco + 7. Siete + 11. Once + 12. Doce + 13. Trece. + +-- markdown -- +Text. + + 1. Uno + 2. Dos + 3. Tres + 5. Cinco + 7. Siete + 11. Once + 12. Doce + 13. Trece. + +-- html -- +
Text. +
Text. +
Text. +
2. Not indented, not a list. +
Text. +
Almost list markers (but not quite): +
- ++
❦ +
- $ ++
❦ +
- $ ++
❦ +
❦ +
1! List. ++
❦ diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list8.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list8.txt new file mode 100644 index 0000000000000000000000000000000000000000..fc46b0d83515531721601563ca259c90b666ed04 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/list8.txt @@ -0,0 +1,56 @@ +-- input -- +Loose lists. + - A + + B + - C + D + - E + - F +-- gofmt -- +Loose lists. + + - A + + B + + - C + D + + - E + + - F +-- text -- +Loose lists. + + - A + + B + + - C D + + - E + + - F +-- markdown -- +Loose lists. + + - A + + B + + - C D + + - E + + - F +-- html -- +
Loose lists. +
A +
B +
C +D +
E +
F +
Hello, world. +This is a paragraph. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/quote.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/quote.txt new file mode 100644 index 0000000000000000000000000000000000000000..b64adae0b36680f05943188eaeb4c63ff2d9a062 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/quote.txt @@ -0,0 +1,15 @@ +-- input -- +Doubled single quotes like `` and '' turn into Unicode double quotes, +but single quotes ` and ' do not. +Misplaced markdown fences ``` do not either. +-- gofmt -- +Doubled single quotes like “ and ” turn into Unicode double quotes, +but single quotes ` and ' do not. +Misplaced markdown fences ``` do not either. +-- text -- +Doubled single quotes like “ and ” turn into Unicode double quotes, but single +quotes ` and ' do not. Misplaced markdown fences ``` do not either. +-- html -- +
Doubled single quotes like “ and ” turn into Unicode double quotes, +but single quotes ` and ' do not. +Misplaced markdown fences ``` do not either. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text.txt new file mode 100644 index 0000000000000000000000000000000000000000..c4de6e20d22d26d8368ab1919374ef754cd16914 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text.txt @@ -0,0 +1,62 @@ +{"TextPrefix":"|", "TextCodePrefix": "@"} +-- input -- +Hello, world + Code block here. +More text. +Tight list + - one + - two + - three +Loose list + - one + + - two + + - three + +# Heading + +More text. +-- gofmt -- +Hello, world + + Code block here. + +More text. +Tight list + - one + - two + - three + +Loose list + + - one + + - two + + - three + +# Heading + +More text. +-- text -- +|Hello, world +| +@Code block here. +| +|More text. Tight list +| - one +| - two +| - three +| +|Loose list +| +| - one +| +| - two +| +| - three +| +|# Heading +| +|More text. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text2.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text2.txt new file mode 100644 index 0000000000000000000000000000000000000000..a099d0b8c686093bee219464583dd00dbfeba302 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text2.txt @@ -0,0 +1,14 @@ +{"TextWidth": -1} +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- +Package gob manages streams of gobs - binary values exchanged between an Encoder (transmitter) and a Decoder (receiver). A typical use is transporting arguments and results of remote procedure calls (RPCs) such as those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream and is most efficient when a single Encoder is used to transmit a stream of values, amortizing the cost of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text3.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text3.txt new file mode 100644 index 0000000000000000000000000000000000000000..75d2c3765ccce2a3d08e8d73573ac1958f6c8776 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text3.txt @@ -0,0 +1,28 @@ +{"TextWidth": 30} +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- +Package gob manages streams +of gobs - binary values +exchanged between an Encoder +(transmitter) and a Decoder +(receiver). A typical use is +transporting arguments and +results of remote procedure +calls (RPCs) such as those +provided by package "net/rpc". + +The implementation compiles +a custom codec for each data +type in the stream and is +most efficient when a single +Encoder is used to transmit a +stream of values, amortizing +the cost of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text4.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text4.txt new file mode 100644 index 0000000000000000000000000000000000000000..e429985077e24e2ff8b3bc49109d9a4a5fa248ab --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text4.txt @@ -0,0 +1,29 @@ +{"TextWidth": 29} +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- +Package gob manages streams +of gobs - binary values +exchanged between an Encoder +(transmitter) and a Decoder +(receiver). A typical use +is transporting arguments +and results of remote +procedure calls (RPCs) such +as those provided by package +"net/rpc". + +The implementation compiles +a custom codec for each data +type in the stream and is +most efficient when a single +Encoder is used to transmit a +stream of values, amortizing +the cost of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text5.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text5.txt new file mode 100644 index 0000000000000000000000000000000000000000..2408fc559d3b36692cca340f05ccd2b3fb2ba9f7 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text5.txt @@ -0,0 +1,38 @@ +{"TextWidth": 20} +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- +Package gob +manages streams +of gobs - binary +values exchanged +between an Encoder +(transmitter) and a +Decoder (receiver). +A typical use +is transporting +arguments and +results of remote +procedure calls +(RPCs) such as those +provided by package +"net/rpc". + +The implementation +compiles a custom +codec for each +data type in the +stream and is most +efficient when a +single Encoder is +used to transmit a +stream of values, +amortizing the cost +of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text6.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text6.txt new file mode 100644 index 0000000000000000000000000000000000000000..d6deff52cf830985d44d9eca26c6b0fbce03c6b7 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text6.txt @@ -0,0 +1,18 @@ +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- +Package gob manages streams of gobs - binary values exchanged between an Encoder +(transmitter) and a Decoder (receiver). A typical use is transporting arguments +and results of remote procedure calls (RPCs) such as those provided by package +"net/rpc". + +The implementation compiles a custom codec for each data type in the stream and +is most efficient when a single Encoder is used to transmit a stream of values, +amortizing the cost of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text7.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text7.txt new file mode 100644 index 0000000000000000000000000000000000000000..c9fb6d37547d1f8cae075ade0d1c2b6539fb6a72 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text7.txt @@ -0,0 +1,21 @@ +{"TextPrefix": " "} +-- input -- +Package gob manages streams of gobs - binary values exchanged between an +Encoder (transmitter) and a Decoder (receiver). A typical use is +transporting arguments and results of remote procedure calls (RPCs) such as +those provided by package "net/rpc". + +The implementation compiles a custom codec for each data type in the stream +and is most efficient when a single Encoder is used to transmit a stream of +values, amortizing the cost of compilation. +-- text -- + Package gob manages streams of gobs - binary values + exchanged between an Encoder (transmitter) and a Decoder + (receiver). A typical use is transporting arguments and + results of remote procedure calls (RPCs) such as those + provided by package "net/rpc". + + The implementation compiles a custom codec for each data + type in the stream and is most efficient when a single + Encoder is used to transmit a stream of values, amortizing + the cost of compilation. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text8.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text8.txt new file mode 100644 index 0000000000000000000000000000000000000000..560ac951c1774359784c694be14470d2bb31e405 --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text8.txt @@ -0,0 +1,94 @@ +{"TextWidth": 40} +-- input -- +If the arguments have version suffixes (like @latest or @v1.0.0), "go install" +builds packages in module-aware mode, ignoring the go.mod file in the current +directory or any parent directory, if there is one. This is useful for +installing executables without affecting the dependencies of the main module. +To eliminate ambiguity about which module versions are used in the build, the +arguments must satisfy the following constraints: + + - Arguments must be package paths or package patterns (with "..." wildcards). + They must not be standard packages (like fmt), meta-patterns (std, cmd, + all), or relative or absolute file paths. + + - All arguments must have the same version suffix. Different queries are not + allowed, even if they refer to the same version. + + - All arguments must refer to packages in the same module at the same version. + + - Package path arguments must refer to main packages. Pattern arguments + will only match main packages. + + - No module is considered the "main" module. If the module containing + packages named on the command line has a go.mod file, it must not contain + directives (replace and exclude) that would cause it to be interpreted + differently than if it were the main module. The module must not require + a higher version of itself. + + - Vendor directories are not used in any module. (Vendor directories are not + included in the module zip files downloaded by 'go install'.) + +If the arguments don't have version suffixes, "go install" may run in +module-aware mode or GOPATH mode, depending on the GO111MODULE environment +variable and the presence of a go.mod file. See 'go help modules' for details. +If module-aware mode is enabled, "go install" runs in the context of the main +module. +-- text -- +If the arguments have version suffixes +(like @latest or @v1.0.0), "go install" +builds packages in module-aware mode, +ignoring the go.mod file in the current +directory or any parent directory, +if there is one. This is useful for +installing executables without affecting +the dependencies of the main module. +To eliminate ambiguity about which +module versions are used in the build, +the arguments must satisfy the following +constraints: + + - Arguments must be package paths + or package patterns (with "..." + wildcards). They must not be + standard packages (like fmt), + meta-patterns (std, cmd, all), + or relative or absolute file paths. + + - All arguments must have the same + version suffix. Different queries + are not allowed, even if they refer + to the same version. + + - All arguments must refer to packages + in the same module at the same + version. + + - Package path arguments must refer + to main packages. Pattern arguments + will only match main packages. + + - No module is considered the "main" + module. If the module containing + packages named on the command line + has a go.mod file, it must not + contain directives (replace and + exclude) that would cause it to be + interpreted differently than if it + were the main module. The module + must not require a higher version of + itself. + + - Vendor directories are not used in + any module. (Vendor directories are + not included in the module zip files + downloaded by 'go install'.) + +If the arguments don't have version +suffixes, "go install" may run in +module-aware mode or GOPATH mode, +depending on the GO111MODULE environment +variable and the presence of a go.mod +file. See 'go help modules' for details. +If module-aware mode is enabled, +"go install" runs in the context of the +main module. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text9.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text9.txt new file mode 100644 index 0000000000000000000000000000000000000000..07a64aa2276a96b24a9ca5794020d30201f4700b --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/text9.txt @@ -0,0 +1,12 @@ +{"TextPrefix":"|", "TextCodePrefix": "@"} +-- input -- +Hello, world + Code block here. +-- gofmt -- +Hello, world + + Code block here. +-- text -- +|Hello, world +| +@Code block here. diff --git a/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/words.txt b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/words.txt new file mode 100644 index 0000000000000000000000000000000000000000..63c7e1a1b2b44a32e5c4ecf0f9fcd9cbe0e1733f --- /dev/null +++ b/platform/dbops/binaries/go/go/src/go/doc/comment/testdata/words.txt @@ -0,0 +1,10 @@ +-- input -- +This is an italicword and a linkedword and Unicöde. +-- gofmt -- +This is an italicword and a linkedword and Unicöde. +-- text -- +This is an italicword and a linkedword and Unicöde. +-- markdown -- +This is an *italicword* and a [*linkedword*](https://example.com/linkedword) and Unicöde. +-- html -- +
This is an italicword and a linkedword and Unicöde.
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/README.md b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/README.md
new file mode 100644
index 0000000000000000000000000000000000000000..a1c18e88ecce05cfc8a3e96008718bbb481004ad
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/README.md
@@ -0,0 +1,12 @@
+These files are processed by example_test.go:TestExamples.
+
+A .golden file is a txtar file with two sections for each example that should be
+created by doc.Examples from the corresponding .go file.
+
+One section, named EXAMPLE_NAME.Output, contains the example's output,
+the value of the field Example.Output.
+
+The other, named EXAMPLE_NAME.Play, contains the formatted code for a playable
+version of the example, the value of the field Example.Play.
+
+If a section is missing, it is treated as being empty.
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.go
new file mode 100644
index 0000000000000000000000000000000000000000..0b10420f4245a61738befad29fbb70a56538508f
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.go
@@ -0,0 +1,8 @@
+// Copyright 2021 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 p
+
+func Example() {}
+func Example_a()
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.golden
new file mode 100644
index 0000000000000000000000000000000000000000..2aafd204352805cd9c94d921fd97fbfd550dfa6c
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/empty.golden
@@ -0,0 +1,6 @@
+-- .Play --
+package main
+
+func main() {}
+func main()
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.go
new file mode 100644
index 0000000000000000000000000000000000000000..ea5d2b37f4aee20811a2abcd0c35abf573f3553a
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.go
@@ -0,0 +1,38 @@
+// Copyright 2021 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 p_test
+
+import (
+ "fmt"
+ "time"
+)
+
+type C1 interface {
+ string | int
+}
+
+type C2 interface {
+ M(time.Time)
+}
+
+type G[T C1] int
+
+func g[T C2](x T) {}
+
+type Tm int
+
+func (Tm) M(time.Time) {}
+
+type Foo int
+
+func Example() {
+ fmt.Println("hello")
+}
+
+func ExampleGeneric() {
+ var x G[string]
+ g(Tm(3))
+ fmt.Println(x)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.golden
new file mode 100644
index 0000000000000000000000000000000000000000..6c7b0eda9f90dc1477125b5235aa421b67791c96
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/generic_constraints.golden
@@ -0,0 +1,39 @@
+-- .Play --
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ fmt.Println("hello")
+}
+-- Generic.Play --
+package main
+
+import (
+ "fmt"
+ "time"
+)
+
+type C1 interface {
+ string | int
+}
+
+type C2 interface {
+ M(time.Time)
+}
+
+type G[T C1] int
+
+func g[T C2](x T) {}
+
+type Tm int
+
+func (Tm) M(time.Time) {}
+
+func main() {
+ var x G[string]
+ g(Tm(3))
+ fmt.Println(x)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.go
new file mode 100644
index 0000000000000000000000000000000000000000..05f21caaaa7c32cffcc6553dd82c93b047df5867
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.go
@@ -0,0 +1,23 @@
+// 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 foo_test
+
+import (
+ "fmt"
+ "time"
+
+ "golang.org/x/time/rate"
+)
+
+func Example() {
+ fmt.Println("Hello, world!")
+ // Output: Hello, world!
+}
+
+func ExampleLimiter() {
+ // Uses fmt, time and rate.
+ l := rate.NewLimiter(rate.Every(time.Second), 1)
+ fmt.Println(l)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.golden
new file mode 100644
index 0000000000000000000000000000000000000000..efe2cc1df5965bd8deb66dd4b746bebf1266af75
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups.golden
@@ -0,0 +1,27 @@
+-- .Play --
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ fmt.Println("Hello, world!")
+}
+-- .Output --
+Hello, world!
+-- Limiter.Play --
+package main
+
+import (
+ "fmt"
+ "time"
+
+ "golang.org/x/time/rate"
+)
+
+func main() {
+ // Uses fmt, time and rate.
+ l := rate.NewLimiter(rate.Every(time.Second), 1)
+ fmt.Println(l)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.go
new file mode 100644
index 0000000000000000000000000000000000000000..377022b22aa996c8c2299c297fd5855cebc18f05
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.go
@@ -0,0 +1,23 @@
+// 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 foo_test
+
+import (
+ "fmt"
+ tm "time"
+
+ r "golang.org/x/time/rate"
+)
+
+func Example() {
+ fmt.Println("Hello, world!")
+ // Output: Hello, world!
+}
+
+func ExampleLimiter() {
+ // Uses fmt, time and rate.
+ l := r.NewLimiter(r.Every(tm.Second), 1)
+ fmt.Println(l)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.golden
new file mode 100644
index 0000000000000000000000000000000000000000..9baf373cd8a5042fe774619e9c246f1740f90d53
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/import_groups_named.golden
@@ -0,0 +1,27 @@
+-- .Play --
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ fmt.Println("Hello, world!")
+}
+-- .Output --
+Hello, world!
+-- Limiter.Play --
+package main
+
+import (
+ "fmt"
+ tm "time"
+
+ r "golang.org/x/time/rate"
+)
+
+func main() {
+ // Uses fmt, time and rate.
+ l := r.NewLimiter(r.Every(tm.Second), 1)
+ fmt.Println(l)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.go
new file mode 100644
index 0000000000000000000000000000000000000000..c4a36e758d23ebf991d46c4f2a2ec8fe77eae301
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.go
@@ -0,0 +1,23 @@
+// Copyright 2021 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 foo_test
+
+import (
+ "bytes"
+ "io"
+)
+
+func getReader() io.Reader { return nil }
+
+func do(b bytes.Reader) {}
+
+func Example() {
+ getReader()
+ do()
+ // Output:
+}
+
+func ExampleIgnored() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.golden
new file mode 100644
index 0000000000000000000000000000000000000000..c0d9b2ecc87eaf043597e95ccf8c4050760f5989
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/inspect_signature.golden
@@ -0,0 +1,24 @@
+-- .Play --
+package main
+
+import (
+ "bytes"
+ "io"
+)
+
+func getReader() io.Reader { return nil }
+
+func do(b bytes.Reader) {}
+
+func main() {
+ getReader()
+ do()
+}
+-- Ignored.Play --
+package main
+
+import ()
+
+func main() {
+}
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.go
new file mode 100644
index 0000000000000000000000000000000000000000..c878b7708ea64a6a22b8590afe5218caf57b28a9
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.go
@@ -0,0 +1,34 @@
+// Copyright 2021 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 foo_test
+
+const (
+ a = iota
+ b
+)
+
+const (
+ c = 3
+ d = 4
+)
+
+const (
+ e = iota
+ f
+)
+
+// The example refers to only one of the constants in the iota group, but we
+// must keep all of them because of the iota. The second group of constants can
+// be trimmed. The third has an iota, but is unused, so it can be eliminated.
+
+func Example() {
+ _ = b
+ _ = d
+}
+
+// Need two examples to hit the playExample function.
+
+func Example2() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.golden
new file mode 100644
index 0000000000000000000000000000000000000000..748770260bb275bdd71991f0e6420cfb1da15e8f
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/iota.golden
@@ -0,0 +1,23 @@
+-- .Play --
+package main
+
+import ()
+
+const (
+ a = iota
+ b
+)
+
+const d = 4
+
+func main() {
+ _ = b
+ _ = d
+}
+-- 2.Play --
+package main
+
+import ()
+
+func main() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.go
new file mode 100644
index 0000000000000000000000000000000000000000..385223acf312bfa783fb6a4d30be5777d7d48c83
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.go
@@ -0,0 +1,223 @@
+// Copyright ©2016 The Gonum Authors. All rights reserved.
+// Copyright 2021 The Go Authors. All rights reserved.
+// (above line required for our license-header checker)
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package community_test
+
+import (
+ "fmt"
+ "log"
+ "sort"
+
+ "golang.org/x/exp/rand"
+
+ "gonum.org/v1/gonum/graph/community"
+ "gonum.org/v1/gonum/graph/internal/ordered"
+ "gonum.org/v1/gonum/graph/simple"
+)
+
+func ExampleProfile_simple() {
+ // Profile calls Modularize which implements the Louvain modularization algorithm.
+ // Since this is a randomized algorithm we use a defined random source to ensure
+ // consistency between test runs. In practice, results will not differ greatly
+ // between runs with different PRNG seeds.
+ src := rand.NewSource(1)
+
+ // Create dumbell graph:
+ //
+ // 0 4
+ // |\ /|
+ // | 2 - 3 |
+ // |/ \|
+ // 1 5
+ //
+ g := simple.NewUndirectedGraph()
+ for u, e := range smallDumbell {
+ for v := range e {
+ g.SetEdge(simple.Edge{F: simple.Node(u), T: simple.Node(v)})
+ }
+ }
+
+ // Get the profile of internal node weight for resolutions
+ // between 0.1 and 10 using logarithmic bisection.
+ p, err := community.Profile(
+ community.ModularScore(g, community.Weight, 10, src),
+ true, 1e-3, 0.1, 10,
+ )
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Print out each step with communities ordered.
+ for _, d := range p {
+ comm := d.Communities()
+ for _, c := range comm {
+ sort.Sort(ordered.ByID(c))
+ }
+ sort.Sort(ordered.BySliceIDs(comm))
+ fmt.Printf("Low:%.2v High:%.2v Score:%v Communities:%v Q=%.3v\n",
+ d.Low, d.High, d.Score, comm, community.Q(g, comm, d.Low))
+ }
+
+ // Output:
+ // Low:0.1 High:0.29 Score:14 Communities:[[0 1 2 3 4 5]] Q=0.9
+ // Low:0.29 High:2.3 Score:12 Communities:[[0 1 2] [3 4 5]] Q=0.714
+ // Low:2.3 High:3.5 Score:4 Communities:[[0 1] [2] [3] [4 5]] Q=-0.31
+ // Low:3.5 High:10 Score:0 Communities:[[0] [1] [2] [3] [4] [5]] Q=-0.607
+}
+
+// intset is an integer set.
+type intset map[int]struct{}
+
+func linksTo(i ...int) intset {
+ if len(i) == 0 {
+ return nil
+ }
+ s := make(intset)
+ for _, v := range i {
+ s[v] = struct{}{}
+ }
+ return s
+}
+
+var (
+ smallDumbell = []intset{
+ 0: linksTo(1, 2),
+ 1: linksTo(2),
+ 2: linksTo(3),
+ 3: linksTo(4, 5),
+ 4: linksTo(5),
+ 5: nil,
+ }
+
+ // http://www.slate.com/blogs/the_world_/2014/07/17/the_middle_east_friendship_chart.html
+ middleEast = struct{ friends, complicated, enemies []intset }{
+ // green cells
+ friends: []intset{
+ 0: nil,
+ 1: linksTo(5, 7, 9, 12),
+ 2: linksTo(11),
+ 3: linksTo(4, 5, 10),
+ 4: linksTo(3, 5, 10),
+ 5: linksTo(1, 3, 4, 8, 10, 12),
+ 6: nil,
+ 7: linksTo(1, 12),
+ 8: linksTo(5, 9, 11),
+ 9: linksTo(1, 8, 12),
+ 10: linksTo(3, 4, 5),
+ 11: linksTo(2, 8),
+ 12: linksTo(1, 5, 7, 9),
+ },
+
+ // yellow cells
+ complicated: []intset{
+ 0: linksTo(2, 4),
+ 1: linksTo(4, 8),
+ 2: linksTo(0, 3, 4, 5, 8, 9),
+ 3: linksTo(2, 8, 11),
+ 4: linksTo(0, 1, 2, 8),
+ 5: linksTo(2),
+ 6: nil,
+ 7: linksTo(9, 11),
+ 8: linksTo(1, 2, 3, 4, 10, 12),
+ 9: linksTo(2, 7, 11),
+ 10: linksTo(8),
+ 11: linksTo(3, 7, 9, 12),
+ 12: linksTo(8, 11),
+ },
+
+ // red cells
+ enemies: []intset{
+ 0: linksTo(1, 3, 5, 6, 7, 8, 9, 10, 11, 12),
+ 1: linksTo(0, 2, 3, 6, 10, 11),
+ 2: linksTo(1, 6, 7, 10, 12),
+ 3: linksTo(0, 1, 6, 7, 9, 12),
+ 4: linksTo(6, 7, 9, 11, 12),
+ 5: linksTo(0, 6, 7, 9, 11),
+ 6: linksTo(0, 1, 2, 3, 4, 5, 7, 8, 9, 10, 11, 12),
+ 7: linksTo(0, 2, 3, 4, 5, 6, 8, 10),
+ 8: linksTo(0, 6, 7),
+ 9: linksTo(0, 3, 4, 5, 6, 10),
+ 10: linksTo(0, 1, 2, 6, 7, 9, 11, 12),
+ 11: linksTo(0, 1, 4, 5, 6, 10),
+ 12: linksTo(0, 2, 3, 4, 6, 10),
+ },
+ }
+)
+
+var friends, enemies *simple.WeightedUndirectedGraph
+
+func init() {
+ friends = simple.NewWeightedUndirectedGraph(0, 0)
+ for u, e := range middleEast.friends {
+ // Ensure unconnected nodes are included.
+ if friends.Node(int64(u)) == nil {
+ friends.AddNode(simple.Node(u))
+ }
+ for v := range e {
+ friends.SetWeightedEdge(simple.WeightedEdge{F: simple.Node(u), T: simple.Node(v), W: 1})
+ }
+ }
+ enemies = simple.NewWeightedUndirectedGraph(0, 0)
+ for u, e := range middleEast.enemies {
+ // Ensure unconnected nodes are included.
+ if enemies.Node(int64(u)) == nil {
+ enemies.AddNode(simple.Node(u))
+ }
+ for v := range e {
+ enemies.SetWeightedEdge(simple.WeightedEdge{F: simple.Node(u), T: simple.Node(v), W: -1})
+ }
+ }
+}
+
+func ExampleProfile_multiplex() {
+ // Profile calls ModularizeMultiplex which implements the Louvain modularization
+ // algorithm. Since this is a randomized algorithm we use a defined random source
+ // to ensure consistency between test runs. In practice, results will not differ
+ // greatly between runs with different PRNG seeds.
+ src := rand.NewSource(1)
+
+ // The undirected graphs, friends and enemies, are the political relationships
+ // in the Middle East as described in the Slate article:
+ // http://www.slate.com/blogs/the_world_/2014/07/17/the_middle_east_friendship_chart.html
+ g, err := community.NewUndirectedLayers(friends, enemies)
+ if err != nil {
+ log.Fatal(err)
+ }
+ weights := []float64{1, -1}
+
+ // Get the profile of internal node weight for resolutions
+ // between 0.1 and 10 using logarithmic bisection.
+ p, err := community.Profile(
+ community.ModularMultiplexScore(g, weights, true, community.WeightMultiplex, 10, src),
+ true, 1e-3, 0.1, 10,
+ )
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Print out each step with communities ordered.
+ for _, d := range p {
+ comm := d.Communities()
+ for _, c := range comm {
+ sort.Sort(ordered.ByID(c))
+ }
+ sort.Sort(ordered.BySliceIDs(comm))
+ fmt.Printf("Low:%.2v High:%.2v Score:%v Communities:%v Q=%.3v\n",
+ d.Low, d.High, d.Score, comm, community.QMultiplex(g, comm, weights, []float64{d.Low}))
+ }
+
+ // Output:
+ // Low:0.1 High:0.72 Score:26 Communities:[[0] [1 7 9 12] [2 8 11] [3 4 5 10] [6]] Q=[24.7 1.97]
+ // Low:0.72 High:1.1 Score:24 Communities:[[0 6] [1 7 9 12] [2 8 11] [3 4 5 10]] Q=[16.9 14.1]
+ // Low:1.1 High:1.2 Score:18 Communities:[[0 2 6 11] [1 7 9 12] [3 4 5 8 10]] Q=[9.16 25.1]
+ // Low:1.2 High:1.6 Score:10 Communities:[[0 3 4 5 6 10] [1 7 9 12] [2 8 11]] Q=[10.5 26.7]
+ // Low:1.6 High:1.6 Score:8 Communities:[[0 1 6 7 9 12] [2 8 11] [3 4 5 10]] Q=[5.56 39.8]
+ // Low:1.6 High:1.8 Score:2 Communities:[[0 2 3 4 5 6 10] [1 7 8 9 11 12]] Q=[-1.82 48.6]
+ // Low:1.8 High:2.3 Score:-6 Communities:[[0 2 3 4 5 6 8 10 11] [1 7 9 12]] Q=[-5 57.5]
+ // Low:2.3 High:2.4 Score:-10 Communities:[[0 1 2 6 7 8 9 11 12] [3 4 5 10]] Q=[-11.2 79]
+ // Low:2.4 High:4.3 Score:-52 Communities:[[0 1 2 3 4 5 6 7 8 9 10 11 12]] Q=[-46.1 117]
+ // Low:4.3 High:10 Score:-54 Communities:[[0 1 2 3 4 6 7 8 9 10 11 12] [5]] Q=[-82 254]
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.golden
new file mode 100644
index 0000000000000000000000000000000000000000..5200d14584f92c696236d41eab73b83261a25076
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/issue43658.golden
@@ -0,0 +1,156 @@
+-- Profile_simple.Play --
+package main
+
+import (
+ "fmt"
+ "log"
+ "sort"
+
+ "golang.org/x/exp/rand"
+
+ "gonum.org/v1/gonum/graph/community"
+ "gonum.org/v1/gonum/graph/internal/ordered"
+ "gonum.org/v1/gonum/graph/simple"
+)
+
+func main() {
+ // Profile calls Modularize which implements the Louvain modularization algorithm.
+ // Since this is a randomized algorithm we use a defined random source to ensure
+ // consistency between test runs. In practice, results will not differ greatly
+ // between runs with different PRNG seeds.
+ src := rand.NewSource(1)
+
+ // Create dumbell graph:
+ //
+ // 0 4
+ // |\ /|
+ // | 2 - 3 |
+ // |/ \|
+ // 1 5
+ //
+ g := simple.NewUndirectedGraph()
+ for u, e := range smallDumbell {
+ for v := range e {
+ g.SetEdge(simple.Edge{F: simple.Node(u), T: simple.Node(v)})
+ }
+ }
+
+ // Get the profile of internal node weight for resolutions
+ // between 0.1 and 10 using logarithmic bisection.
+ p, err := community.Profile(
+ community.ModularScore(g, community.Weight, 10, src),
+ true, 1e-3, 0.1, 10,
+ )
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Print out each step with communities ordered.
+ for _, d := range p {
+ comm := d.Communities()
+ for _, c := range comm {
+ sort.Sort(ordered.ByID(c))
+ }
+ sort.Sort(ordered.BySliceIDs(comm))
+ fmt.Printf("Low:%.2v High:%.2v Score:%v Communities:%v Q=%.3v\n",
+ d.Low, d.High, d.Score, comm, community.Q(g, comm, d.Low))
+ }
+
+}
+
+// intset is an integer set.
+type intset map[int]struct{}
+
+func linksTo(i ...int) intset {
+ if len(i) == 0 {
+ return nil
+ }
+ s := make(intset)
+ for _, v := range i {
+ s[v] = struct{}{}
+ }
+ return s
+}
+
+var smallDumbell = []intset{
+ 0: linksTo(1, 2),
+ 1: linksTo(2),
+ 2: linksTo(3),
+ 3: linksTo(4, 5),
+ 4: linksTo(5),
+ 5: nil,
+}
+
+-- Profile_simple.Output --
+Low:0.1 High:0.29 Score:14 Communities:[[0 1 2 3 4 5]] Q=0.9
+Low:0.29 High:2.3 Score:12 Communities:[[0 1 2] [3 4 5]] Q=0.714
+Low:2.3 High:3.5 Score:4 Communities:[[0 1] [2] [3] [4 5]] Q=-0.31
+Low:3.5 High:10 Score:0 Communities:[[0] [1] [2] [3] [4] [5]] Q=-0.607
+
+-- Profile_multiplex.Play --
+
+package main
+
+import (
+ "fmt"
+ "log"
+ "sort"
+
+ "golang.org/x/exp/rand"
+
+ "gonum.org/v1/gonum/graph/community"
+ "gonum.org/v1/gonum/graph/internal/ordered"
+ "gonum.org/v1/gonum/graph/simple"
+)
+
+var friends, enemies *simple.WeightedUndirectedGraph
+
+func main() {
+ // Profile calls ModularizeMultiplex which implements the Louvain modularization
+ // algorithm. Since this is a randomized algorithm we use a defined random source
+ // to ensure consistency between test runs. In practice, results will not differ
+ // greatly between runs with different PRNG seeds.
+ src := rand.NewSource(1)
+
+ // The undirected graphs, friends and enemies, are the political relationships
+ // in the Middle East as described in the Slate article:
+ // http://www.slate.com/blogs/the_world_/2014/07/17/the_middle_east_friendship_chart.html
+ g, err := community.NewUndirectedLayers(friends, enemies)
+ if err != nil {
+ log.Fatal(err)
+ }
+ weights := []float64{1, -1}
+
+ // Get the profile of internal node weight for resolutions
+ // between 0.1 and 10 using logarithmic bisection.
+ p, err := community.Profile(
+ community.ModularMultiplexScore(g, weights, true, community.WeightMultiplex, 10, src),
+ true, 1e-3, 0.1, 10,
+ )
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // Print out each step with communities ordered.
+ for _, d := range p {
+ comm := d.Communities()
+ for _, c := range comm {
+ sort.Sort(ordered.ByID(c))
+ }
+ sort.Sort(ordered.BySliceIDs(comm))
+ fmt.Printf("Low:%.2v High:%.2v Score:%v Communities:%v Q=%.3v\n",
+ d.Low, d.High, d.Score, comm, community.QMultiplex(g, comm, weights, []float64{d.Low}))
+ }
+
+}
+-- Profile_multiplex.Output --
+Low:0.1 High:0.72 Score:26 Communities:[[0] [1 7 9 12] [2 8 11] [3 4 5 10] [6]] Q=[24.7 1.97]
+Low:0.72 High:1.1 Score:24 Communities:[[0 6] [1 7 9 12] [2 8 11] [3 4 5 10]] Q=[16.9 14.1]
+Low:1.1 High:1.2 Score:18 Communities:[[0 2 6 11] [1 7 9 12] [3 4 5 8 10]] Q=[9.16 25.1]
+Low:1.2 High:1.6 Score:10 Communities:[[0 3 4 5 6 10] [1 7 9 12] [2 8 11]] Q=[10.5 26.7]
+Low:1.6 High:1.6 Score:8 Communities:[[0 1 6 7 9 12] [2 8 11] [3 4 5 10]] Q=[5.56 39.8]
+Low:1.6 High:1.8 Score:2 Communities:[[0 2 3 4 5 6 10] [1 7 8 9 11 12]] Q=[-1.82 48.6]
+Low:1.8 High:2.3 Score:-6 Communities:[[0 2 3 4 5 6 8 10 11] [1 7 9 12]] Q=[-5 57.5]
+Low:2.3 High:2.4 Score:-10 Communities:[[0 1 2 6 7 8 9 11 12] [3 4 5 10]] Q=[-11.2 79]
+Low:2.4 High:4.3 Score:-52 Communities:[[0 1 2 3 4 5 6 7 8 9 10 11 12]] Q=[-46.1 117]
+Low:4.3 High:10 Score:-54 Communities:[[0 1 2 3 4 6 7 8 9 10 11 12] [5]] Q=[-82 254]
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.go
new file mode 100644
index 0000000000000000000000000000000000000000..27282644d8fd478b7838b1139592c33d082b8b4f
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.go
@@ -0,0 +1,98 @@
+// Copyright 2021 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 foo_test
+
+import (
+ "flag"
+ "fmt"
+ "log"
+ "os/exec"
+ "sort"
+)
+
+func ExampleHello() {
+ fmt.Println("Hello, world!")
+ // Output: Hello, world!
+}
+
+func ExampleImport() {
+ out, err := exec.Command("date").Output()
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("The date is %s\n", out)
+}
+
+func ExampleKeyValue() {
+ v := struct {
+ a string
+ b int
+ }{
+ a: "A",
+ b: 1,
+ }
+ fmt.Print(v)
+ // Output: a: "A", b: 1
+}
+
+func ExampleKeyValueImport() {
+ f := flag.Flag{
+ Name: "play",
+ }
+ fmt.Print(f)
+ // Output: Name: "play"
+}
+
+var keyValueTopDecl = struct {
+ a string
+ b int
+}{
+ a: "B",
+ b: 2,
+}
+
+func ExampleKeyValueTopDecl() {
+ fmt.Print(keyValueTopDecl)
+ // Output: a: "B", b: 2
+}
+
+// Person represents a person by name and age.
+type Person struct {
+ Name string
+ Age int
+}
+
+// String returns a string representation of the Person.
+func (p Person) String() string {
+ return fmt.Sprintf("%s: %d", p.Name, p.Age)
+}
+
+// ByAge implements sort.Interface for []Person based on
+// the Age field.
+type ByAge []Person
+
+// Len returns the number of elements in ByAge.
+func (a ByAge) Len() int { return len(a) }
+
+// Swap swaps the elements in ByAge.
+func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age }
+
+// people is the array of Person
+var people = []Person{
+ {"Bob", 31},
+ {"John", 42},
+ {"Michael", 17},
+ {"Jenny", 26},
+}
+
+func ExampleSort() {
+ fmt.Println(people)
+ sort.Sort(ByAge(people))
+ fmt.Println(people)
+ // Output:
+ // [Bob: 31 John: 42 Michael: 17 Jenny: 26]
+ // [Michael: 17 Jenny: 26 Bob: 31 John: 42]
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.golden
new file mode 100644
index 0000000000000000000000000000000000000000..d2d791effabf7e8ebaff66de5d399027aea6440d
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/multiple.golden
@@ -0,0 +1,129 @@
+-- Hello.Play --
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ fmt.Println("Hello, world!")
+}
+-- Hello.Output --
+Hello, world!
+-- Import.Play --
+package main
+
+import (
+ "fmt"
+ "log"
+ "os/exec"
+)
+
+func main() {
+ out, err := exec.Command("date").Output()
+ if err != nil {
+ log.Fatal(err)
+ }
+ fmt.Printf("The date is %s\n", out)
+}
+-- KeyValue.Play --
+package main
+
+import (
+ "fmt"
+)
+
+func main() {
+ v := struct {
+ a string
+ b int
+ }{
+ a: "A",
+ b: 1,
+ }
+ fmt.Print(v)
+}
+-- KeyValue.Output --
+a: "A", b: 1
+-- KeyValueImport.Play --
+package main
+
+import (
+ "flag"
+ "fmt"
+)
+
+func main() {
+ f := flag.Flag{
+ Name: "play",
+ }
+ fmt.Print(f)
+}
+-- KeyValueImport.Output --
+Name: "play"
+-- KeyValueTopDecl.Play --
+package main
+
+import (
+ "fmt"
+)
+
+var keyValueTopDecl = struct {
+ a string
+ b int
+}{
+ a: "B",
+ b: 2,
+}
+
+func main() {
+ fmt.Print(keyValueTopDecl)
+}
+-- KeyValueTopDecl.Output --
+a: "B", b: 2
+-- Sort.Play --
+package main
+
+import (
+ "fmt"
+ "sort"
+)
+
+// Person represents a person by name and age.
+type Person struct {
+ Name string
+ Age int
+}
+
+// String returns a string representation of the Person.
+func (p Person) String() string {
+ return fmt.Sprintf("%s: %d", p.Name, p.Age)
+}
+
+// ByAge implements sort.Interface for []Person based on
+// the Age field.
+type ByAge []Person
+
+// Len returns the number of elements in ByAge.
+func (a ByAge) Len() int { return len(a) }
+
+// Swap swaps the elements in ByAge.
+func (a ByAge) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a ByAge) Less(i, j int) bool { return a[i].Age < a[j].Age }
+
+// people is the array of Person
+var people = []Person{
+ {"Bob", 31},
+ {"John", 42},
+ {"Michael", 17},
+ {"Jenny", 26},
+}
+
+func main() {
+ fmt.Println(people)
+ sort.Sort(ByAge(people))
+ fmt.Println(people)
+}
+-- Sort.Output --
+[Bob: 31 John: 42 Michael: 17 Jenny: 26]
+[Michael: 17 Jenny: 26 Bob: 31 John: 42]
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.go
new file mode 100644
index 0000000000000000000000000000000000000000..64b0de476d19de840c5f4f95b1708df479decb46
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.go
@@ -0,0 +1,22 @@
+// Copyright 2021 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 foo_test
+
+// Variable declaration with fewer values than names.
+
+func f() (int, int) {
+ return 1, 2
+}
+
+var a, b = f()
+
+// Need two examples to hit playExample.
+
+func ExampleA() {
+ _ = a
+}
+
+func ExampleB() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.golden
new file mode 100644
index 0000000000000000000000000000000000000000..00c19917af100ed9c294f43fba0df44bbd9a06ae
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/values.golden
@@ -0,0 +1,21 @@
+-- A.Play --
+package main
+
+import ()
+
+func f() (int, int) {
+ return 1, 2
+}
+
+var a, b = f()
+
+func main() {
+ _ = a
+}
+-- B.Play --
+package main
+
+import ()
+
+func main() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.go
new file mode 100644
index 0000000000000000000000000000000000000000..61954ceceaafb0e7347544a4518e4ea0db4a4b18
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.go
@@ -0,0 +1,23 @@
+// Copyright 2021 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 foo_test
+
+import "fmt"
+
+type X int
+
+func (X) Foo() {
+}
+
+func (X) TestBlah() {
+}
+
+func (X) BenchmarkFoo() {
+}
+
+func Example() {
+ fmt.Println("Hello, world!")
+ // Output: Hello, world!
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.golden
new file mode 100644
index 0000000000000000000000000000000000000000..74a2291f5140a5635942d8d9c42b62afc55bd75e
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_file.golden
@@ -0,0 +1,21 @@
+-- .Play --
+package main
+
+import "fmt"
+
+type X int
+
+func (X) Foo() {
+}
+
+func (X) TestBlah() {
+}
+
+func (X) BenchmarkFoo() {
+}
+
+func main() {
+ fmt.Println("Hello, world!")
+}
+-- .Output --
+Hello, world!
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.go
new file mode 100644
index 0000000000000000000000000000000000000000..1754ee341281115d200ab8fd5799d76aa7109628
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.go
@@ -0,0 +1,13 @@
+// Copyright 2021 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 foo_test
+
+func Foo(x int) {
+}
+
+func Example() {
+ fmt.Println("Hello, world!")
+ // Output: Hello, world!
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.golden
new file mode 100644
index 0000000000000000000000000000000000000000..7d5b5cbd7f9a2f54e37480bf60021f2ef22bdc5c
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function.golden
@@ -0,0 +1,11 @@
+-- .Play --
+package main
+
+func Foo(x int) {
+}
+
+func main() {
+ fmt.Println("Hello, world!")
+}
+-- .Output --
+Hello, world!
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.go
new file mode 100644
index 0000000000000000000000000000000000000000..0e0e2f58560530f04e2ee3ec74bd1ec8d1dae5e2
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.go
@@ -0,0 +1,12 @@
+// Copyright 2021 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 foo_test
+
+func foo(int)
+
+func Example() {
+ foo(42)
+ // Output:
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.golden
new file mode 100644
index 0000000000000000000000000000000000000000..ec8f114abe255381466f285675743afa88065312
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/examples/whole_function_external.golden
@@ -0,0 +1,8 @@
+-- .Play --
+package main
+
+func foo(int)
+
+func main() {
+ foo(42)
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue16153.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue16153.go
new file mode 100644
index 0000000000000000000000000000000000000000..528be4235608fc9ad636e5acb78889633e7cfcfb
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue16153.go
@@ -0,0 +1,27 @@
+// Copyright 2017 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 issue16153
+
+// original test case
+const (
+ x1 uint8 = 255
+ Y1 = 256
+)
+
+// variations
+const (
+ x2 uint8 = 255
+ Y2
+)
+
+const (
+ X3 int64 = iota
+ Y3 = 1
+)
+
+const (
+ X4 int64 = iota
+ Y4
+)
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.0.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.0.golden
new file mode 100644
index 0000000000000000000000000000000000000000..42c00da50414f697aea681ac2de663e896eba32c
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.0.golden
@@ -0,0 +1,8 @@
+//
+PACKAGE issue17788
+
+IMPORTPATH
+ testdata/issue17788
+
+FILENAMES
+ testdata/issue17788.go
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.1.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.1.golden
new file mode 100644
index 0000000000000000000000000000000000000000..42c00da50414f697aea681ac2de663e896eba32c
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.1.golden
@@ -0,0 +1,8 @@
+//
+PACKAGE issue17788
+
+IMPORTPATH
+ testdata/issue17788
+
+FILENAMES
+ testdata/issue17788.go
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.2.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.2.golden
new file mode 100644
index 0000000000000000000000000000000000000000..42c00da50414f697aea681ac2de663e896eba32c
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.2.golden
@@ -0,0 +1,8 @@
+//
+PACKAGE issue17788
+
+IMPORTPATH
+ testdata/issue17788
+
+FILENAMES
+ testdata/issue17788.go
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.go
new file mode 100644
index 0000000000000000000000000000000000000000..883ad5f76954d7eba81fffdfa00642cb7a7ee47d
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue17788.go
@@ -0,0 +1,8 @@
+// Copyright 2016 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 issue17788
+
+func ( /* receiver type */ ) f0() {
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.0.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.0.golden
new file mode 100644
index 0000000000000000000000000000000000000000..a88f43f4bd7e219bdaf3b6ca670ac57d0b351324
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.0.golden
@@ -0,0 +1,45 @@
+//
+PACKAGE issue22856
+
+IMPORTPATH
+ testdata/issue22856
+
+FILENAMES
+ testdata/issue22856.go
+
+FUNCTIONS
+ // NewPointerSliceOfSlice is not a factory function because slices ...
+ func NewPointerSliceOfSlice() [][]*T
+
+ // NewSlice3 is not a factory function because 3 nested slices of ...
+ func NewSlice3() [][][]T
+
+ // NewSliceOfSlice is not a factory function because slices of a ...
+ func NewSliceOfSlice() [][]T
+
+
+TYPES
+ //
+ type T struct{}
+
+ //
+ func New() T
+
+ //
+ func NewArray() [1]T
+
+ //
+ func NewPointer() *T
+
+ //
+ func NewPointerArray() [1]*T
+
+ //
+ func NewPointerOfPointer() **T
+
+ //
+ func NewPointerSlice() []*T
+
+ //
+ func NewSlice() []T
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.1.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.1.golden
new file mode 100644
index 0000000000000000000000000000000000000000..a88f43f4bd7e219bdaf3b6ca670ac57d0b351324
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.1.golden
@@ -0,0 +1,45 @@
+//
+PACKAGE issue22856
+
+IMPORTPATH
+ testdata/issue22856
+
+FILENAMES
+ testdata/issue22856.go
+
+FUNCTIONS
+ // NewPointerSliceOfSlice is not a factory function because slices ...
+ func NewPointerSliceOfSlice() [][]*T
+
+ // NewSlice3 is not a factory function because 3 nested slices of ...
+ func NewSlice3() [][][]T
+
+ // NewSliceOfSlice is not a factory function because slices of a ...
+ func NewSliceOfSlice() [][]T
+
+
+TYPES
+ //
+ type T struct{}
+
+ //
+ func New() T
+
+ //
+ func NewArray() [1]T
+
+ //
+ func NewPointer() *T
+
+ //
+ func NewPointerArray() [1]*T
+
+ //
+ func NewPointerOfPointer() **T
+
+ //
+ func NewPointerSlice() []*T
+
+ //
+ func NewSlice() []T
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.2.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.2.golden
new file mode 100644
index 0000000000000000000000000000000000000000..a88f43f4bd7e219bdaf3b6ca670ac57d0b351324
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.2.golden
@@ -0,0 +1,45 @@
+//
+PACKAGE issue22856
+
+IMPORTPATH
+ testdata/issue22856
+
+FILENAMES
+ testdata/issue22856.go
+
+FUNCTIONS
+ // NewPointerSliceOfSlice is not a factory function because slices ...
+ func NewPointerSliceOfSlice() [][]*T
+
+ // NewSlice3 is not a factory function because 3 nested slices of ...
+ func NewSlice3() [][][]T
+
+ // NewSliceOfSlice is not a factory function because slices of a ...
+ func NewSliceOfSlice() [][]T
+
+
+TYPES
+ //
+ type T struct{}
+
+ //
+ func New() T
+
+ //
+ func NewArray() [1]T
+
+ //
+ func NewPointer() *T
+
+ //
+ func NewPointerArray() [1]*T
+
+ //
+ func NewPointerOfPointer() **T
+
+ //
+ func NewPointerSlice() []*T
+
+ //
+ func NewSlice() []T
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.go
new file mode 100644
index 0000000000000000000000000000000000000000..f4569981aaac659ae081aa3233ce159e0f18ca78
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/issue22856.go
@@ -0,0 +1,27 @@
+// Copyright 2017 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 issue22856
+
+type T struct{}
+
+func New() T { return T{} }
+func NewPointer() *T { return &T{} }
+func NewPointerSlice() []*T { return []*T{&T{}} }
+func NewSlice() []T { return []T{T{}} }
+func NewPointerOfPointer() **T { x := &T{}; return &x }
+func NewArray() [1]T { return [1]T{T{}} }
+func NewPointerArray() [1]*T { return [1]*T{&T{}} }
+
+// NewSliceOfSlice is not a factory function because slices of a slice of
+// type *T are not factory functions of type T.
+func NewSliceOfSlice() [][]T { return []T{[]T{}} }
+
+// NewPointerSliceOfSlice is not a factory function because slices of a
+// slice of type *T are not factory functions of type T.
+func NewPointerSliceOfSlice() [][]*T { return []*T{[]*T{}} }
+
+// NewSlice3 is not a factory function because 3 nested slices of type T
+// are not factory functions of type T.
+func NewSlice3() [][][]T { return []T{[]T{[]T{}}} }
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/pkgdoc/doc.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/pkgdoc/doc.go
new file mode 100644
index 0000000000000000000000000000000000000000..3f822c75546c637bf5c03bbe0acc8d16c4a878bd
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/pkgdoc/doc.go
@@ -0,0 +1,24 @@
+// 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 pkgdoc
+
+import (
+ crand "crypto/rand"
+ "math/rand"
+)
+
+type T int
+
+type U int
+
+func (T) M() {}
+
+var _ = rand.Int
+var _ = crand.Reader
+
+type G[T any] struct{ x T }
+
+func (g G[T]) M1() {}
+func (g *G[T]) M2() {}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.0.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.0.golden
new file mode 100644
index 0000000000000000000000000000000000000000..9f37b069f072a552cc7eabfd02617bbe30e49f0d
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.0.golden
@@ -0,0 +1,8 @@
+// Package predeclared is a go/doc test for handling of exported ...
+PACKAGE predeclared
+
+IMPORTPATH
+ testdata/predeclared
+
+FILENAMES
+ testdata/predeclared.go
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.1.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.1.golden
new file mode 100644
index 0000000000000000000000000000000000000000..2ff8ee666bd9467b32a6a6df66ef386f44805efb
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.1.golden
@@ -0,0 +1,22 @@
+// Package predeclared is a go/doc test for handling of exported ...
+PACKAGE predeclared
+
+IMPORTPATH
+ testdata/predeclared
+
+FILENAMES
+ testdata/predeclared.go
+
+TYPES
+ //
+ type bool int
+
+ // Must not be visible.
+ func (b bool) String() string
+
+ //
+ type error struct{}
+
+ // Must not be visible.
+ func (e error) Error() string
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.2.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.2.golden
new file mode 100644
index 0000000000000000000000000000000000000000..9f37b069f072a552cc7eabfd02617bbe30e49f0d
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.2.golden
@@ -0,0 +1,8 @@
+// Package predeclared is a go/doc test for handling of exported ...
+PACKAGE predeclared
+
+IMPORTPATH
+ testdata/predeclared
+
+FILENAMES
+ testdata/predeclared.go
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.go
new file mode 100644
index 0000000000000000000000000000000000000000..c6dd806cba0c2704fcc40912680ad95c4b2745b9
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/predeclared.go
@@ -0,0 +1,22 @@
+// Copyright 2016 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 predeclared is a go/doc test for handling of
+// exported methods on locally-defined predeclared types.
+// See issue 9860.
+package predeclared
+
+type error struct{}
+
+// Must not be visible.
+func (e error) Error() string {
+ return ""
+}
+
+type bool int
+
+// Must not be visible.
+func (b bool) String() string {
+ return ""
+}
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/template.txt b/platform/dbops/binaries/go/go/src/go/doc/testdata/template.txt
new file mode 100644
index 0000000000000000000000000000000000000000..1b07382611660bd28daf1fd32d2ae73e4b9f12bd
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/template.txt
@@ -0,0 +1,68 @@
+{{synopsis .Doc}}
+PACKAGE {{.Name}}
+
+IMPORTPATH
+ {{.ImportPath}}
+
+{{with .Imports}}IMPORTS
+{{range .}} {{.}}
+{{end}}
+{{end}}{{/*
+
+*/}}FILENAMES
+{{range .Filenames}} {{.}}
+{{end}}{{/*
+
+*/}}{{with .Consts}}
+CONSTANTS
+{{range .}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{end}}{{/*
+
+*/}}{{with .Vars}}
+VARIABLES
+{{range .}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{end}}{{/*
+
+*/}}{{with .Funcs}}
+FUNCTIONS
+{{range .}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{end}}{{/*
+
+*/}}{{with .Types}}
+TYPES
+{{range .}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{range .Consts}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{/*
+
+*/}}{{range .Vars}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{/*
+
+*/}}{{range .Funcs}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{/*
+
+*/}}{{range .Methods}} {{synopsis .Doc}}
+ {{node .Decl $.FSet}}
+
+{{end}}{{end}}{{end}}{{/*
+
+*/}}{{with .Bugs}}
+BUGS .Bugs is now deprecated, please use .Notes instead
+{{range .}}{{indent "\t" .}}
+{{end}}{{end}}{{with .Notes}}{{range $marker, $content := .}}
+{{$marker}}S
+{{range $content}}{{$marker}}({{.UID}}){{indent "\t" .Body}}
+{{end}}{{end}}{{end}}
\ No newline at end of file
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.0.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.0.golden
new file mode 100644
index 0000000000000000000000000000000000000000..61dac8bb66ca5937e374e1cb14ae8083e66f1561
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.0.golden
@@ -0,0 +1,156 @@
+// Package testing provides support for automated testing of Go ...
+PACKAGE testing
+
+IMPORTPATH
+ testdata/testing
+
+IMPORTS
+ bytes
+ flag
+ fmt
+ io
+ os
+ runtime
+ runtime/pprof
+ strconv
+ strings
+ time
+
+FILENAMES
+ testdata/benchmark.go
+ testdata/example.go
+ testdata/testing.go
+
+FUNCTIONS
+ // An internal function but exported because it is cross-package; ...
+ func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
+
+ // An internal function but exported because it is cross-package; ...
+ func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
+
+ //
+ func RunExamples(examples []InternalExample) (ok bool)
+
+ //
+ func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
+
+ // Short reports whether the -test.short flag is set.
+ func Short() bool
+
+
+TYPES
+ // B is a type passed to Benchmark functions to manage benchmark ...
+ type B struct {
+ N int
+ // contains filtered or unexported fields
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *B) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *B) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *B) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *B) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *B) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *B) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *B) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *B) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *B) Logf(format string, args ...any)
+
+ // ResetTimer sets the elapsed benchmark time to zero. It does not ...
+ func (b *B) ResetTimer()
+
+ // SetBytes records the number of bytes processed in a single ...
+ func (b *B) SetBytes(n int64)
+
+ // StartTimer starts timing a test. This function is called ...
+ func (b *B) StartTimer()
+
+ // StopTimer stops timing a test. This can be used to pause the ...
+ func (b *B) StopTimer()
+
+ // The results of a benchmark run.
+ type BenchmarkResult struct {
+ N int // The number of iterations.
+ T time.Duration // The total time taken.
+ Bytes int64 // Bytes processed in one iteration.
+ }
+
+ // Benchmark benchmarks a single function. Useful for creating ...
+ func Benchmark(f func(b *B)) BenchmarkResult
+
+ //
+ func (r BenchmarkResult) NsPerOp() int64
+
+ //
+ func (r BenchmarkResult) String() string
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalBenchmark struct {
+ Name string
+ F func(b *B)
+ }
+
+ //
+ type InternalExample struct {
+ Name string
+ F func()
+ Output string
+ }
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalTest struct {
+ Name string
+ F func(*T)
+ }
+
+ // T is a type passed to Test functions to manage test state and ...
+ type T struct {
+ // contains filtered or unexported fields
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *T) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *T) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *T) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *T) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *T) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *T) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *T) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *T) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *T) Logf(format string, args ...any)
+
+ // Parallel signals that this test is to be run in parallel with ...
+ func (t *T) Parallel()
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.1.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.1.golden
new file mode 100644
index 0000000000000000000000000000000000000000..1655af11a8cddb7487058e753148908ae9f867c2
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.1.golden
@@ -0,0 +1,298 @@
+// Package testing provides support for automated testing of Go ...
+PACKAGE testing
+
+IMPORTPATH
+ testdata/testing
+
+IMPORTS
+ bytes
+ flag
+ fmt
+ io
+ os
+ runtime
+ runtime/pprof
+ strconv
+ strings
+ time
+
+FILENAMES
+ testdata/benchmark.go
+ testdata/example.go
+ testdata/testing.go
+
+VARIABLES
+ //
+ var (
+ // The short flag requests that tests run more quickly, but its functionality
+ // is provided by test writers themselves. The testing package is just its
+ // home. The all.bash installation script sets it to make installation more
+ // efficient, but by default the flag is off so a plain "go test" will do a
+ // full test of the package.
+ short = flag.Bool("test.short", false, "run smaller test suite to save time")
+
+ // Report as tests are run; default is silent for success.
+ chatty = flag.Bool("test.v", false, "verbose: print additional output")
+ match = flag.String("test.run", "", "regular expression to select tests to run")
+ memProfile = flag.String("test.memprofile", "", "write a memory profile to the named file after execution")
+ memProfileRate = flag.Int("test.memprofilerate", 0, "if >=0, sets runtime.MemProfileRate")
+ cpuProfile = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution")
+ timeout = flag.Duration("test.timeout", 0, "if positive, sets an aggregate time limit for all tests")
+ cpuListStr = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test")
+ parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism")
+
+ cpuList []int
+ )
+
+ //
+ var benchTime = flag.Duration("test.benchtime", 1*time.Second, "approximate run time for each benchmark")
+
+ //
+ var matchBenchmarks = flag.String("test.bench", "", "regular expression to select benchmarks to run")
+
+ //
+ var timer *time.Timer
+
+
+FUNCTIONS
+ // An internal function but exported because it is cross-package; ...
+ func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
+
+ // An internal function but exported because it is cross-package; ...
+ func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
+
+ //
+ func RunExamples(examples []InternalExample) (ok bool)
+
+ //
+ func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
+
+ // Short reports whether the -test.short flag is set.
+ func Short() bool
+
+ // after runs after all testing.
+ func after()
+
+ // alarm is called if the timeout expires.
+ func alarm()
+
+ // before runs before all testing.
+ func before()
+
+ // decorate inserts the final newline if needed and indentation ...
+ func decorate(s string, addFileLine bool) string
+
+ //
+ func max(x, y int) int
+
+ //
+ func min(x, y int) int
+
+ //
+ func parseCpuList()
+
+ // roundDown10 rounds a number down to the nearest power of 10.
+ func roundDown10(n int) int
+
+ // roundUp rounds x up to a number of the form [1eX, 2eX, 5eX].
+ func roundUp(n int) int
+
+ // startAlarm starts an alarm if requested.
+ func startAlarm()
+
+ // stopAlarm turns off the alarm.
+ func stopAlarm()
+
+ //
+ func tRunner(t *T, test *InternalTest)
+
+
+TYPES
+ // B is a type passed to Benchmark functions to manage benchmark ...
+ type B struct {
+ common
+ N int
+ benchmark InternalBenchmark
+ bytes int64
+ timerOn bool
+ result BenchmarkResult
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *B) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *B) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *B) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *B) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *B) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *B) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *B) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *B) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *B) Logf(format string, args ...any)
+
+ // ResetTimer sets the elapsed benchmark time to zero. It does not ...
+ func (b *B) ResetTimer()
+
+ // SetBytes records the number of bytes processed in a single ...
+ func (b *B) SetBytes(n int64)
+
+ // StartTimer starts timing a test. This function is called ...
+ func (b *B) StartTimer()
+
+ // StopTimer stops timing a test. This can be used to pause the ...
+ func (b *B) StopTimer()
+
+ // launch launches the benchmark function. It gradually increases ...
+ func (b *B) launch()
+
+ // log generates the output. It's always at the same stack depth.
+ func (c *B) log(s string)
+
+ //
+ func (b *B) nsPerOp() int64
+
+ // run times the benchmark function in a separate goroutine.
+ func (b *B) run() BenchmarkResult
+
+ // runN runs a single benchmark for the specified number of ...
+ func (b *B) runN(n int)
+
+ // trimOutput shortens the output from a benchmark, which can be ...
+ func (b *B) trimOutput()
+
+ // The results of a benchmark run.
+ type BenchmarkResult struct {
+ N int // The number of iterations.
+ T time.Duration // The total time taken.
+ Bytes int64 // Bytes processed in one iteration.
+ }
+
+ // Benchmark benchmarks a single function. Useful for creating ...
+ func Benchmark(f func(b *B)) BenchmarkResult
+
+ //
+ func (r BenchmarkResult) NsPerOp() int64
+
+ //
+ func (r BenchmarkResult) String() string
+
+ //
+ func (r BenchmarkResult) mbPerSec() float64
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalBenchmark struct {
+ Name string
+ F func(b *B)
+ }
+
+ //
+ type InternalExample struct {
+ Name string
+ F func()
+ Output string
+ }
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalTest struct {
+ Name string
+ F func(*T)
+ }
+
+ // T is a type passed to Test functions to manage test state and ...
+ type T struct {
+ common
+ name string // Name of test.
+ startParallel chan bool // Parallel tests will wait on this.
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *T) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *T) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *T) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *T) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *T) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *T) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *T) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *T) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *T) Logf(format string, args ...any)
+
+ // Parallel signals that this test is to be run in parallel with ...
+ func (t *T) Parallel()
+
+ // log generates the output. It's always at the same stack depth.
+ func (c *T) log(s string)
+
+ //
+ func (t *T) report()
+
+ // common holds the elements common between T and B and captures ...
+ type common struct {
+ output []byte // Output generated by test or benchmark.
+ failed bool // Test or benchmark has failed.
+ start time.Time // Time test or benchmark started
+ duration time.Duration
+ self any // To be sent on signal channel when done.
+ signal chan any // Output for serial tests.
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *common) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *common) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *common) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *common) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *common) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *common) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *common) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *common) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *common) Logf(format string, args ...any)
+
+ // log generates the output. It's always at the same stack depth.
+ func (c *common) log(s string)
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.2.golden b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.2.golden
new file mode 100644
index 0000000000000000000000000000000000000000..61dac8bb66ca5937e374e1cb14ae8083e66f1561
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.2.golden
@@ -0,0 +1,156 @@
+// Package testing provides support for automated testing of Go ...
+PACKAGE testing
+
+IMPORTPATH
+ testdata/testing
+
+IMPORTS
+ bytes
+ flag
+ fmt
+ io
+ os
+ runtime
+ runtime/pprof
+ strconv
+ strings
+ time
+
+FILENAMES
+ testdata/benchmark.go
+ testdata/example.go
+ testdata/testing.go
+
+FUNCTIONS
+ // An internal function but exported because it is cross-package; ...
+ func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample)
+
+ // An internal function but exported because it is cross-package; ...
+ func RunBenchmarks(matchString func(pat, str string) (bool, error), benchmarks []InternalBenchmark)
+
+ //
+ func RunExamples(examples []InternalExample) (ok bool)
+
+ //
+ func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool)
+
+ // Short reports whether the -test.short flag is set.
+ func Short() bool
+
+
+TYPES
+ // B is a type passed to Benchmark functions to manage benchmark ...
+ type B struct {
+ N int
+ // contains filtered or unexported fields
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *B) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *B) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *B) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *B) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *B) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *B) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *B) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *B) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *B) Logf(format string, args ...any)
+
+ // ResetTimer sets the elapsed benchmark time to zero. It does not ...
+ func (b *B) ResetTimer()
+
+ // SetBytes records the number of bytes processed in a single ...
+ func (b *B) SetBytes(n int64)
+
+ // StartTimer starts timing a test. This function is called ...
+ func (b *B) StartTimer()
+
+ // StopTimer stops timing a test. This can be used to pause the ...
+ func (b *B) StopTimer()
+
+ // The results of a benchmark run.
+ type BenchmarkResult struct {
+ N int // The number of iterations.
+ T time.Duration // The total time taken.
+ Bytes int64 // Bytes processed in one iteration.
+ }
+
+ // Benchmark benchmarks a single function. Useful for creating ...
+ func Benchmark(f func(b *B)) BenchmarkResult
+
+ //
+ func (r BenchmarkResult) NsPerOp() int64
+
+ //
+ func (r BenchmarkResult) String() string
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalBenchmark struct {
+ Name string
+ F func(b *B)
+ }
+
+ //
+ type InternalExample struct {
+ Name string
+ F func()
+ Output string
+ }
+
+ // An internal type but exported because it is cross-package; part ...
+ type InternalTest struct {
+ Name string
+ F func(*T)
+ }
+
+ // T is a type passed to Test functions to manage test state and ...
+ type T struct {
+ // contains filtered or unexported fields
+ }
+
+ // Error is equivalent to Log() followed by Fail().
+ func (c *T) Error(args ...any)
+
+ // Errorf is equivalent to Logf() followed by Fail().
+ func (c *T) Errorf(format string, args ...any)
+
+ // Fail marks the function as having failed but continues ...
+ func (c *T) Fail()
+
+ // FailNow marks the function as having failed and stops its ...
+ func (c *T) FailNow()
+
+ // Failed reports whether the function has failed.
+ func (c *T) Failed() bool
+
+ // Fatal is equivalent to Log() followed by FailNow().
+ func (c *T) Fatal(args ...any)
+
+ // Fatalf is equivalent to Logf() followed by FailNow().
+ func (c *T) Fatalf(format string, args ...any)
+
+ // Log formats its arguments using default formatting, analogous ...
+ func (c *T) Log(args ...any)
+
+ // Logf formats its arguments according to the format, analogous ...
+ func (c *T) Logf(format string, args ...any)
+
+ // Parallel signals that this test is to be run in parallel with ...
+ func (t *T) Parallel()
+
diff --git a/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.go b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.go
new file mode 100644
index 0000000000000000000000000000000000000000..d3076c95b502736b2ae9d7bf3d3efec20258b121
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/doc/testdata/testing.go
@@ -0,0 +1,404 @@
+// Copyright 2009 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 testing provides support for automated testing of Go packages.
+// It is intended to be used in concert with the “go test” utility, which automates
+// execution of any function of the form
+// func TestXxx(*testing.T)
+// where Xxx can be any alphanumeric string (but the first letter must not be in
+// [a-z]) and serves to identify the test routine.
+// These TestXxx routines should be declared within the package they are testing.
+//
+// Functions of the form
+// func BenchmarkXxx(*testing.B)
+// are considered benchmarks, and are executed by go test when the -test.bench
+// flag is provided.
+//
+// A sample benchmark function looks like this:
+// func BenchmarkHello(b *testing.B) {
+// for i := 0; i < b.N; i++ {
+// fmt.Sprintf("hello")
+// }
+// }
+// The benchmark package will vary b.N until the benchmark function lasts
+// long enough to be timed reliably. The output
+// testing.BenchmarkHello 10000000 282 ns/op
+// means that the loop ran 10000000 times at a speed of 282 ns per loop.
+//
+// If a benchmark needs some expensive setup before running, the timer
+// may be stopped:
+// func BenchmarkBigLen(b *testing.B) {
+// b.StopTimer()
+// big := NewBig()
+// b.StartTimer()
+// for i := 0; i < b.N; i++ {
+// big.Len()
+// }
+// }
+package testing
+
+import (
+ "flag"
+ "fmt"
+ "os"
+ "runtime"
+ "runtime/pprof"
+ "strconv"
+ "strings"
+ "time"
+)
+
+var (
+ // The short flag requests that tests run more quickly, but its functionality
+ // is provided by test writers themselves. The testing package is just its
+ // home. The all.bash installation script sets it to make installation more
+ // efficient, but by default the flag is off so a plain "go test" will do a
+ // full test of the package.
+ short = flag.Bool("test.short", false, "run smaller test suite to save time")
+
+ // Report as tests are run; default is silent for success.
+ chatty = flag.Bool("test.v", false, "verbose: print additional output")
+ match = flag.String("test.run", "", "regular expression to select tests to run")
+ memProfile = flag.String("test.memprofile", "", "write a memory profile to the named file after execution")
+ memProfileRate = flag.Int("test.memprofilerate", 0, "if >=0, sets runtime.MemProfileRate")
+ cpuProfile = flag.String("test.cpuprofile", "", "write a cpu profile to the named file during execution")
+ timeout = flag.Duration("test.timeout", 0, "if positive, sets an aggregate time limit for all tests")
+ cpuListStr = flag.String("test.cpu", "", "comma-separated list of number of CPUs to use for each test")
+ parallel = flag.Int("test.parallel", runtime.GOMAXPROCS(0), "maximum test parallelism")
+
+ cpuList []int
+)
+
+// common holds the elements common between T and B and
+// captures common methods such as Errorf.
+type common struct {
+ output []byte // Output generated by test or benchmark.
+ failed bool // Test or benchmark has failed.
+ start time.Time // Time test or benchmark started
+ duration time.Duration
+ self any // To be sent on signal channel when done.
+ signal chan any // Output for serial tests.
+}
+
+// Short reports whether the -test.short flag is set.
+func Short() bool {
+ return *short
+}
+
+// decorate inserts the final newline if needed and indentation tabs for formatting.
+// If addFileLine is true, it also prefixes the string with the file and line of the call site.
+func decorate(s string, addFileLine bool) string {
+ if addFileLine {
+ _, file, line, ok := runtime.Caller(3) // decorate + log + public function.
+ if ok {
+ // Truncate file name at last file name separator.
+ if index := strings.LastIndex(file, "/"); index >= 0 {
+ file = file[index+1:]
+ } else if index = strings.LastIndex(file, "\\"); index >= 0 {
+ file = file[index+1:]
+ }
+ } else {
+ file = "???"
+ line = 1
+ }
+ s = fmt.Sprintf("%s:%d: %s", file, line, s)
+ }
+ s = "\t" + s // Every line is indented at least one tab.
+ n := len(s)
+ if n > 0 && s[n-1] != '\n' {
+ s += "\n"
+ n++
+ }
+ for i := 0; i < n-1; i++ { // -1 to avoid final newline
+ if s[i] == '\n' {
+ // Second and subsequent lines are indented an extra tab.
+ return s[0:i+1] + "\t" + decorate(s[i+1:n], false)
+ }
+ }
+ return s
+}
+
+// T is a type passed to Test functions to manage test state and support formatted test logs.
+// Logs are accumulated during execution and dumped to standard error when done.
+type T struct {
+ common
+ name string // Name of test.
+ startParallel chan bool // Parallel tests will wait on this.
+}
+
+// Fail marks the function as having failed but continues execution.
+func (c *common) Fail() { c.failed = true }
+
+// Failed reports whether the function has failed.
+func (c *common) Failed() bool { return c.failed }
+
+// FailNow marks the function as having failed and stops its execution.
+// Execution will continue at the next Test.
+func (c *common) FailNow() {
+ c.Fail()
+
+ // Calling runtime.Goexit will exit the goroutine, which
+ // will run the deferred functions in this goroutine,
+ // which will eventually run the deferred lines in tRunner,
+ // which will signal to the test loop that this test is done.
+ //
+ // A previous version of this code said:
+ //
+ // c.duration = ...
+ // c.signal <- c.self
+ // runtime.Goexit()
+ //
+ // This previous version duplicated code (those lines are in
+ // tRunner no matter what), but worse the goroutine teardown
+ // implicit in runtime.Goexit was not guaranteed to complete
+ // before the test exited. If a test deferred an important cleanup
+ // function (like removing temporary files), there was no guarantee
+ // it would run on a test failure. Because we send on c.signal during
+ // a top-of-stack deferred function now, we know that the send
+ // only happens after any other stacked defers have completed.
+ runtime.Goexit()
+}
+
+// log generates the output. It's always at the same stack depth.
+func (c *common) log(s string) {
+ c.output = append(c.output, decorate(s, true)...)
+}
+
+// Log formats its arguments using default formatting, analogous to Println(),
+// and records the text in the error log.
+func (c *common) Log(args ...any) { c.log(fmt.Sprintln(args...)) }
+
+// Logf formats its arguments according to the format, analogous to Printf(),
+// and records the text in the error log.
+func (c *common) Logf(format string, args ...any) { c.log(fmt.Sprintf(format, args...)) }
+
+// Error is equivalent to Log() followed by Fail().
+func (c *common) Error(args ...any) {
+ c.log(fmt.Sprintln(args...))
+ c.Fail()
+}
+
+// Errorf is equivalent to Logf() followed by Fail().
+func (c *common) Errorf(format string, args ...any) {
+ c.log(fmt.Sprintf(format, args...))
+ c.Fail()
+}
+
+// Fatal is equivalent to Log() followed by FailNow().
+func (c *common) Fatal(args ...any) {
+ c.log(fmt.Sprintln(args...))
+ c.FailNow()
+}
+
+// Fatalf is equivalent to Logf() followed by FailNow().
+func (c *common) Fatalf(format string, args ...any) {
+ c.log(fmt.Sprintf(format, args...))
+ c.FailNow()
+}
+
+// Parallel signals that this test is to be run in parallel with (and only with)
+// other parallel tests in this CPU group.
+func (t *T) Parallel() {
+ t.signal <- (*T)(nil) // Release main testing loop
+ <-t.startParallel // Wait for serial tests to finish
+}
+
+// An internal type but exported because it is cross-package; part of the implementation
+// of go test.
+type InternalTest struct {
+ Name string
+ F func(*T)
+}
+
+func tRunner(t *T, test *InternalTest) {
+ t.start = time.Now()
+
+ // When this goroutine is done, either because test.F(t)
+ // returned normally or because a test failure triggered
+ // a call to runtime.Goexit, record the duration and send
+ // a signal saying that the test is done.
+ defer func() {
+ t.duration = time.Since(t.start)
+ t.signal <- t
+ }()
+
+ test.F(t)
+}
+
+// An internal function but exported because it is cross-package; part of the implementation
+// of go test.
+func Main(matchString func(pat, str string) (bool, error), tests []InternalTest, benchmarks []InternalBenchmark, examples []InternalExample) {
+ flag.Parse()
+ parseCpuList()
+
+ before()
+ startAlarm()
+ testOk := RunTests(matchString, tests)
+ exampleOk := RunExamples(examples)
+ if !testOk || !exampleOk {
+ fmt.Println("FAIL")
+ os.Exit(1)
+ }
+ fmt.Println("PASS")
+ stopAlarm()
+ RunBenchmarks(matchString, benchmarks)
+ after()
+}
+
+func (t *T) report() {
+ tstr := fmt.Sprintf("(%.2f seconds)", t.duration.Seconds())
+ format := "--- %s: %s %s\n%s"
+ if t.failed {
+ fmt.Printf(format, "FAIL", t.name, tstr, t.output)
+ } else if *chatty {
+ fmt.Printf(format, "PASS", t.name, tstr, t.output)
+ }
+}
+
+func RunTests(matchString func(pat, str string) (bool, error), tests []InternalTest) (ok bool) {
+ ok = true
+ if len(tests) == 0 {
+ fmt.Fprintln(os.Stderr, "testing: warning: no tests to run")
+ return
+ }
+ for _, procs := range cpuList {
+ runtime.GOMAXPROCS(procs)
+ // We build a new channel tree for each run of the loop.
+ // collector merges in one channel all the upstream signals from parallel tests.
+ // If all tests pump to the same channel, a bug can occur where a test
+ // kicks off a goroutine that Fails, yet the test still delivers a completion signal,
+ // which skews the counting.
+ var collector = make(chan any)
+
+ numParallel := 0
+ startParallel := make(chan bool)
+
+ for i := 0; i < len(tests); i++ {
+ matched, err := matchString(*match, tests[i].Name)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "testing: invalid regexp for -test.run: %s\n", err)
+ os.Exit(1)
+ }
+ if !matched {
+ continue
+ }
+ testName := tests[i].Name
+ if procs != 1 {
+ testName = fmt.Sprintf("%s-%d", tests[i].Name, procs)
+ }
+ t := &T{
+ common: common{
+ signal: make(chan any),
+ },
+ name: testName,
+ startParallel: startParallel,
+ }
+ t.self = t
+ if *chatty {
+ fmt.Printf("=== RUN %s\n", t.name)
+ }
+ go tRunner(t, &tests[i])
+ out := (<-t.signal).(*T)
+ if out == nil { // Parallel run.
+ go func() {
+ collector <- <-t.signal
+ }()
+ numParallel++
+ continue
+ }
+ t.report()
+ ok = ok && !out.failed
+ }
+
+ running := 0
+ for numParallel+running > 0 {
+ if running < *parallel && numParallel > 0 {
+ startParallel <- true
+ running++
+ numParallel--
+ continue
+ }
+ t := (<-collector).(*T)
+ t.report()
+ ok = ok && !t.failed
+ running--
+ }
+ }
+ return
+}
+
+// before runs before all testing.
+func before() {
+ if *memProfileRate > 0 {
+ runtime.MemProfileRate = *memProfileRate
+ }
+ if *cpuProfile != "" {
+ f, err := os.Create(*cpuProfile)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "testing: %s", err)
+ return
+ }
+ if err := pprof.StartCPUProfile(f); err != nil {
+ fmt.Fprintf(os.Stderr, "testing: can't start cpu profile: %s", err)
+ f.Close()
+ return
+ }
+ // Could save f so after can call f.Close; not worth the effort.
+ }
+
+}
+
+// after runs after all testing.
+func after() {
+ if *cpuProfile != "" {
+ pprof.StopCPUProfile() // flushes profile to disk
+ }
+ if *memProfile != "" {
+ f, err := os.Create(*memProfile)
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "testing: %s", err)
+ return
+ }
+ if err = pprof.WriteHeapProfile(f); err != nil {
+ fmt.Fprintf(os.Stderr, "testing: can't write %s: %s", *memProfile, err)
+ }
+ f.Close()
+ }
+}
+
+var timer *time.Timer
+
+// startAlarm starts an alarm if requested.
+func startAlarm() {
+ if *timeout > 0 {
+ timer = time.AfterFunc(*timeout, alarm)
+ }
+}
+
+// stopAlarm turns off the alarm.
+func stopAlarm() {
+ if *timeout > 0 {
+ timer.Stop()
+ }
+}
+
+// alarm is called if the timeout expires.
+func alarm() {
+ panic("test timed out")
+}
+
+func parseCpuList() {
+ if len(*cpuListStr) == 0 {
+ cpuList = append(cpuList, runtime.GOMAXPROCS(-1))
+ } else {
+ for _, val := range strings.Split(*cpuListStr, ",") {
+ cpu, err := strconv.Atoi(val)
+ if err != nil || cpu <= 0 {
+ fmt.Fprintf(os.Stderr, "testing: invalid value %q for -test.cpu", val)
+ os.Exit(1)
+ }
+ cpuList = append(cpuList, cpu)
+ }
+ }
+}
diff --git a/platform/dbops/binaries/go/go/src/go/internal/gccgoimporter/ar.go b/platform/dbops/binaries/go/go/src/go/internal/gccgoimporter/ar.go
new file mode 100644
index 0000000000000000000000000000000000000000..9df7934212611b34d21d49b035dc5b7794547a48
--- /dev/null
+++ b/platform/dbops/binaries/go/go/src/go/internal/gccgoimporter/ar.go
@@ -0,0 +1,171 @@
+// Copyright 2018 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 gccgoimporter
+
+import (
+ "bytes"
+ "debug/elf"
+ "errors"
+ "fmt"
+ "internal/xcoff"
+ "io"
+ "strconv"
+ "strings"
+)
+
+// Magic strings for different archive file formats.
+const (
+ armag = "!